Skip to content

Instantly share code, notes, and snippets.

@Miopas
Created February 27, 2019 06:48
  • Star 0 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 Miopas/a162a565bd2168d3084d30f8201347f5 to your computer and use it in GitHub Desktop.
HTML entity convert
# reference: https://stackoverflow.com/questions/2087370/decode-html-entities-in-python-string
from bs4 import BeautifulSoup
BeautifulSoup("<p>&pound;682m</p>")
# output is like:
# <html><body><p>£682m</p></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment