Skip to content

Instantly share code, notes, and snippets.

@dangra
Created January 25, 2014 02:17
Show Gist options
  • Save dangra/8610776 to your computer and use it in GitHub Desktop.
Save dangra/8610776 to your computer and use it in GitHub Desktop.
import encodings
import lxml.etree
for enc in set(encodings.aliases.aliases.values()):
try:
parser = lxml.etree.HTMLParser(recover=True, encoding=enc)
except LookupError as exc:
print str(exc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment