question on HTMLParser and parser.feed()

Stephen Briley sdb1031 at yahoo.com
Sat Dec 6 06:52:35 CET 2003


Hi,

I'm new to Python, so please bear with me..

I am satisfied with the HTMLparse of my htmlsource
page.  But I am unable to save the output of
parser.feed(htmlsource).  When I type
parser.feed(htmlsource) into the interpreter, the
correct output streams across the screen.  But all of
my attempts to capture this output to a variable are
unsucessful (e.g. capt_text =
parser.feed(htmlsource)).  

What am I missing and how can I get this to work? 
Thanks in advance!


from htmllib import HTMLParser
from formatter import AbstractFormatter, DumbWriter
parser = HTMLParser(AbstractFormatter(DumbWriter()))
parser.feed(htmlsource)

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/





More information about the Python-list mailing list