Python: How to handles HTML escape characters

 

import HTMLParser

import cgi

 

#unescape

escape_txt =’<abc>’

hp= HTMLParser.HTMLParser ()

unescape_txt = hp.unescape(escape_txt )

 

#escape

escape_txt = cgi.escape(unescape_txt)

 


Read More: