Re: Finding Line numbers of HTML file

2007-12-13 Thread Stefan Behnel
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 -- http://mail.python.org/

Re: Finding Line numbers of HTML file

2007-12-13 Thread Paul McGuire
On Dec 13, 9:01 am, Ramdas <[EMAIL PROTECTED]> wrote: > Hi Paul, > > I am cross posting the same to grab your attention at pyparsing forums > too. 1000 apologies on the same count! > > I am a complete newbie to parsing and totally new to pyparsing. > > I have adapted your code to store the line num

Re: Finding Line numbers of HTML file

2007-12-13 Thread Ramdas
Hi Paul, I am cross posting the same to grab your attention at pyparsing forums too. 1000 apologies on the same count! I am a complete newbie to parsing and totally new to pyparsing. I have adapted your code to store the line numbers as below. Surprisingly, the line numbers printed, when I s

Re: Finding Line numbers of HTML file

2007-12-13 Thread Ramdas
Hi Paul, I am cross posting the same to grab your attention at pyparsing forums too. 1000 apologies on the same count! I am a complete newbie to parsing and totally new to pyparsing. I have adapted your code to store the line numbers as below. Surprisingly, the line numbers printed, when I scrap

Re: Finding Line numbers of HTML file

2007-12-12 Thread Ramdas
Hey paul, Thanks a Ton! Never heard of pyparsing module. This is more a hobby, than any homework. This is exactly what I wanted. I am scrapping a few web pages for data. I am using Beautiful Soup for tag extraction. However for some quirky reasons, I need to reference back to the exact line n

Re: Finding Line numbers of HTML file

2007-12-12 Thread Paul McGuire
On Dec 12, 3:56 pm, Ramdas <[EMAIL PROTECTED]> 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 > Homework, perhaps? Well, I don't think your instructor will give many points for a p

Re: Finding Line numbers of HTML file

2007-12-12 Thread Larry Bates
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 > > I tried a few things, but I am just not able to work with either if > the parsers. > > > > Can someone help > HTML d

Finding Line numbers of HTML file

2007-12-12 Thread Ramdas
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 I tried a few things, but I am just not able to work with either if the parsers. Can someone help -- http://mail.python.org/mailman/listinfo/p