On this page
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 < 10 & café") == "5 < 10 & café"
Gotchas
- Handles all HTML5 named, decimal, and hex character references.
REPL Inspect
from html import unescape
help(unescape)
Linked from
Related notes
- tuts/python3/stdlib_module/html/escape Linked here; links to this page; shared tags: #html, #stdlib
- tuts/python3/stdlib_module/html Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib
- tuts/c/stdlib/ctype/isspace shared tags: #stdlib