html实体编码:
import cgi
def htmlescape(str):
return(cgi.escape(str))
print(htmlescape("&"))
html解码
def htmlunescape(str):
h=HTMLParser()
return(h.unescape(str))
print(htmlunescape("&"))
html实体编码:
import cgi
def htmlescape(str):
return(cgi.escape(str))
print(htmlescape("&"))
html解码
def htmlunescape(str):
h=HTMLParser()
return(h.unescape(str))
print(htmlunescape("&"))