The HTML you are processing consists of several lines. You must pass the re.DOTALL flag to findall as follows:
print re.findall('<hgroup>(.*?)</hgroup>', request, re.DOTALL)
It allows . match newlines and returns the correct output.
@jsalonen is right, of course, that parsing HTML with regular expression is a daunting task. However, in small cases, for example, for a one-time script, I would say that this is acceptable.
source share