En Fri, 25 Apr 2008 19:35:58 -0300, John <[EMAIL PROTECTED]> escribió:

I'm working with the HTMLParser module and have implemented
HTMLParser.handle_starttag() and I see there is a separate
handle_data
method (which can be implemented), but I am not clear how to tie this
together with a given start tag, so I only get the data I want.

For example, I'd like to get a handle on the character data ( the
number 1) immediately after the following start tag


<span class="calPast">
1</br>
.
.
.
Any ideas?

I usually don't recommend HTMLParser because a lot of HTML documents in the Web are not even remotely valid, and the parser can't handle that. BeautifulSoup is a more robust alternative: <http://www.crummy.com/software/BeautifulSoup/>


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to