html.parser.HTMLParser.handle_comment()

HTMLParser.handle_comment(data) This method is called when a comment is encountered (e.g. <!--comment-->). For example, the comment <!-- comment --> will cause this method to be called with the argument ' comment '. The content of Internet Explorer conditional comments (condcoms) will also be sent to this method, so, for <!--[if IE 9]>IE9-specific content<![endif]-->, this method will receive '[if IE 9]>IE9-specific content<![endif]'.

html.parser.HTMLParser.handle_data()

HTMLParser.handle_data(data) This method is called to process arbitrary data (e.g. text nodes and the content of <script>...</script> and <style>...</style>).

html.parser.HTMLParser.handle_decl()

HTMLParser.handle_decl(decl) This method is called to handle an HTML doctype declaration (e.g. <!DOCTYPE html>). The decl parameter will be the entire contents of the declaration inside the <!...> markup (e.g. 'DOCTYPE html').

html.entities.name2codepoint

html.entities.name2codepoint A dictionary that maps HTML entity names to the Unicode code points.

html.parser.HTMLParser.feed()

HTMLParser.feed(data) Feed some text to the parser. It is processed insofar as it consists of complete elements; incomplete data is buffered until more data is fed or close() is called. data must be str.

html.escape()

html.escape(s, quote=True) Convert the characters &, < and > in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag quote is true, the characters (") and (') are also translated; this helps for inclusion in an HTML attribute value delimited by quotes, as in <a href="...">. New in version 3.2.

html.parser.HTMLParser.close()

HTMLParser.close() Force processing of all buffered data as if it were followed by an end-of-file mark. This method may be redefined by a derived class to define additional processing at the end of the input, but the redefined version should always call the HTMLParser base class method close().

html.parser.HTMLParser

class html.parser.HTMLParser(*, convert_charrefs=True) Create a parser instance able to parse invalid markup. If convert_charrefs is True (the default), all character references (except the ones in script/style elements) are automatically converted to the corresponding Unicode characters. An HTMLParser instance is fed HTML data and calls handler methods when start tags, end tags, text, comments, and other markup elements are encountered. The user should subclass HTMLParser and override its m

html.entities.html5

html.entities.html5 A dictionary that maps HTML5 named character references [1] to the equivalent Unicode character(s), e.g. html5['gt;'] == '>'. Note that the trailing semicolon is included in the name (e.g. 'gt;'), however some of the names are accepted by the standard even without the semicolon: in this case the name is present with and without the ';'. See also html.unescape(). New in version 3.3.

hmac.new()

hmac.new(key, msg=None, digestmod=None) Return a new hmac object. key is a bytes or bytearray object giving the secret key. If msg is present, the method call update(msg) is made. digestmod is the digest name, digest constructor or module for the HMAC object to use. It supports any name suitable to hashlib.new() and defaults to the hashlib.md5 constructor. Changed in version 3.4: Parameter key can be a bytes or bytearray object. Parameter msg can be of any type supported by hashlib. Paramet