The HTMLParser module defines a class, HTMLParser, that can be used to parse HTML and XHTML documents. To use this module, you define your own class that inherits from HTMLParser and redefines methods as appropriate.
This is a base class that is used to create HTML parsers. It is initialized without any arguments.
An instance, h, of HTMLParser has the following methods:
Closes the parser and forces the processing of any remaining unparsed data. This method is called after all HTML data has been fed to the parser.
Supplies new data to the parser. This data will be immediately parsed. However, if the data is incomplete (for example, it ends with an incomplete HTML element), the incomplete portion will ...