HTML Escape and Unescape using Python

html library

import html

text = '<b id="test">\'Hi\'</b>'
escaped = html.escape(text)
print(escaped)

text = html.unescape(escaped)
print(text)

Leave a Comment

Cancel reply

Your email address will not be published.