本篇博客来源:
用python处理html代码的转义与还原 '; &; <; >; "; ';等特殊字符
摘要:
html转义:
import html
# 字符串转义
str = "<tag>aaa</tag>"
str_out = html.escape(str)
print(str_out) # <tag>aaa</tag>
# 转义还原
str_out = html.unescape(str_out)
print(str_out) # <tag>aaa</tag>
标签:gt,python,转义,lt,html,str,out
From: https://www.cnblogs.com/brian-sun/p/17037845.html