Create a string array of all comments in a html file...

Robin Becker robin at NOSPAMreportlab.com
Sun Sep 30 11:54:12 EDT 2007


sophie_newbie wrote:
> Hi, I'm wondering how i'd go about extracting a string array of all
> comments in a HTML file, HTML comments obviously taking the format
> "<!-- Comment text here -->".
> 
> I'm fairly stumped on how to do this? Maybe using regular expressions?
> 
> Thanks.
> 
You should probably eat beautiful soup at

http://www.crummy.com/software/BeautifulSoup/documentation.html

which helps with this sort of task.
-- 
Robin Becker



More information about the Python-list mailing list