unescape html to python string
import urllib2 | |
import sys | |
def cleanupString(string): | |
string = urllib2.unquote(string).decode('utf8') | |
return HTMLParser.HTMLParser().unescape(string).encode(sys.getfilesystemencoding()) |
This comment has been minimized.
This comment has been minimized.
Very helpful, however you need to import HTMLParser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Thanks, this was really useful! :)