On this page
  1. html.unescape
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

html.unescape

Prev: html.escape | Up: html
Rel: html.escape
Ref: docs.python.org — html.unescape
Tags: #public #python3 #stdlib #html


Import

import html
from html import unescape

Signature & Overview

html.unescape(s)

Convert all named and numeric character references (e.g. >, >, &x3e;) in the string s to the corresponding unicode characters.

Usage

import html

assert html.unescape("5 &lt; 10 &amp; caf&#233;") == "5 < 10 & café"

Gotchas

REPL Inspect

from html import unescape
help(unescape)

Linked from

Related notes