Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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())
@alexweber

This comment has been minimized.

Show comment
Hide comment
@alexweber

alexweber Aug 31, 2016

Thanks, this was really useful! :)

Thanks, this was really useful! :)

@wsherby

This comment has been minimized.

Show comment
Hide comment
@wsherby

wsherby Aug 16, 2017

Very helpful, however you need to import HTMLParser

wsherby commented Aug 16, 2017

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