I am writing a scanner to get certain parts of an html file. But I can't figure out how to use re.findall ().
Here is an example when I want to find the whole ... part in a file, I can write something like this:
re.findall("<div>.*\</div>", result_page)
if result_page is a string "<div> </div> <div> </div>", the result will be
['<div> </div> <div> </div>']
Only a whole line. This is not what I want, I expect the two divs to be separate. What should I do?
source
share