getting text inside the HTML tag

Will Maier willmaier at ml1.net
Sat Jul 14 14:39:08 EDT 2007


On Sat, Jul 14, 2007 at 05:47:22PM +0000, Nikola Skoric wrote:
> I'm using sgmllib.SGMLParser to parse HTML. I have successfuly
> parsed start tags by implementing start_something method. But, now
> I have to fetch the string inside the start tag and end tag too. I
> have been reading through SGMLParser documentation, but just can't
> figure that out...

You need to define handle_data. You may also want to look at
HTMLParser in addition to the alternatives previously mentioned.

http://docs.python.org/lib/module-sgmllib.html

-- 

[Will Maier]-----------------[willmaier at ml1.net|http://www.lfod.us/]



More information about the Python-list mailing list