Finding Line numbers of HTML file

Stefan Behnel stefan.behnel-n05pAM at web.de
Fri Dec 14 02:54:13 EST 2007


Ramdas wrote:
> I am doing some HTML scrapping for a side project.
> 
> I need a method using sgmllib or HTMLParser to parse an HTML file and
> get line nos of all the tags

Try lxml.html, it provides line numbers for each element.

http://codespeak.net/lxml/dev/

Stefan



More information about the Python-list mailing list