Module HTMLParser :: Class HTMLParser
[hide private]
[frames] | no frames]

_ClassType HTMLParser

markupbase.ParserBase --+

Find tags and other markup and call handler functions.

    p = HTMLParser()

Start tags are handled by calling self.handle_starttag() or
self.handle_startendtag(); end tags by self.handle_endtag().  The
data between tags is passed from the parser to the derived class
by calling self.handle_data() with the data as argument (the data
may be split up in arbitrary chunks).  Entity references are
passed by calling self.handle_entityref() with the entity
reference as the argument.  Numeric character references are
passed to self.handle_charref() with the string containing the
reference as the argument.

Instance Methods [hide private]
Initialize and reset this instance.
Reset this instance.
feed(self, data)
Feed data to the parser.
Handle any buffered data.
error(self, message)
Return full source of start tag: '<...>'.
goahead(self, end)
parse_pi(self, i)
parse_starttag(self, i)
check_for_whole_start_tag(self, i)
parse_endtag(self, i)
handle_startendtag(self, tag, attrs)
handle_starttag(self, tag, attrs)
handle_endtag(self, tag)
handle_charref(self, name)
handle_entityref(self, name)
handle_data(self, data)
handle_comment(self, data)
handle_decl(self, decl)
handle_pi(self, data)
unknown_decl(self, data)
unescape(self, s)

Inherited from markupbase.ParserBase: getpos, parse_comment, parse_declaration, parse_marked_section, updatepos

Class Variables [hide private]
  CDATA_CONTENT_ELEMENTS = ('script', 'style')
  __starttag_text = None

Inherited from markupbase.ParserBase (private): _decl_otherchars

Method Details [hide private]



Initialize and reset this instance.

Overrides: markupbase.ParserBase.__init__



Reset this instance. Loses all unprocessed data.

Overrides: markupbase.ParserBase.reset

feed(self, data)

Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '

error(self, message)

Overrides: markupbase.ParserBase.error

unknown_decl(self, data)

Overrides: markupbase.ParserBase.unknown_decl