Skip to content

Instantly share code, notes, and snippets.

@Zuckonit
Created February 17, 2014 03:12
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Zuckonit/9044051 to your computer and use it in GitHub Desktop.
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())
@wsherby
Copy link

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