htmlparser in python this module is called html parser the htmlparser module defines class htmlparser that can be used to parse html and xhtml documents to use this moduleyou define your own class that inherits from htmlparser and redefines methods as appropriate htmlparser(this is base class that is used to create html parsers it is initialized without any arguments an instance of htmlparser has the following methodsh close(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 feed(datasupplies new data to the parser this data will be immediately parsed howeverif the data is incomplete (for exampleit ends with an incomplete html element)the incomplete portion will be buffered and parsed the next time feed(is called with more data getpos(returns the current line number and character offset into that line as tuple (lineoffseth get_starttag_text(returns the text corresponding to the most recently opened start tag handle_charref(namethis handler method is called whenever character reference such as '&#ref;is encountered name is string containing the name of the reference for examplewhen parsing '&# ;'name will be set to ' handle_comment(datathis handler method is called whenever comment is encountered data is string containing the text of the comment for examplewhen parsing the comment ''data will contain the text 'commenth handle_data(datathis handler is called to process data that appears between tags data is string containing text handle_decl(declthis handler is called to process declarations such as 'decl is string containing the text of the declaration not including the leading '<!and trailing '> lib fl ff