Q: about htmllib.HTMLParser

Alex the_brain at mit.edu
Mon Oct 30 07:58:21 EST 2000


> Hi, I need to make "start_blockquote" in HTMLParser, but I can't find
> what parameters the function has.  How can I find each parameter for
> each call back function of HTMLParser ?  Thanks.

Go into the interactive interpreter, and type something like this:

>>> import htmllib
>>> htmllib
<module 'htmllib' from '/mit/python/arch/sun4x_57/lib/python2.0/htmllib.pyc'>
>>> 

...then take the 'c' off the end of the of the filename, load it into
your favourite editor, and have a look at the signature of
start_blockquote.  I did this one ahead of time, hope this helps :)

    def start_blockquote(self, attrs):
        self.formatter.end_paragraph(1)
        self.formatter.push_margin('blockquote')

Alex.

-- 
Speak softly but carry a big carrot.




More information about the Python-list mailing list