I'm trying to get the contents of a <ul> tag from a webpage in python. I used the following code:
matchResult = re.search(r'<ul\s*content="MSL">(.*)</ul>', queryResult, re.MULTILINE)
This does not work.
However if I remove the line breaks by using
queryResult = queryResult.replace('\r','').replace('\n','')
It works.
This regular expression in PHP works fine without removing line breaks:
preg_match('@<ul\s*content="MSL">(.*)</ul>@msU', $queryResult, $matches);
How can I match over multiple lines using Python?