html.unescape()
html.unescape() is a Python function in the HTML Module category. Converts HTML entities back to characters. The syntax is html.unescape(s). Returns: Unescaped string. A typical example: html.unescape("<hello>") # "". A close sibling is html.escape(), which converts special HTML characters (&, <, >, ", ') to HTML-safe entities. A close sibling is html.parser.HTMLParser(), which a push parser for HTML that calls handler methods for tags and data. More about this category: HTML escaping — escape, unescape, HTMLParser. Related HTML Module entries: html.escape(), html.parser.HTMLParser(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try html.unescape() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.