Skip to content

Instantly share code, notes, and snippets.

@sagorbrur
Created November 30, 2019 09:01
Show Gist options
  • Save sagorbrur/c62cf96c1f197e881097c51821b3db6b to your computer and use it in GitHub Desktop.
Save sagorbrur/c62cf96c1f197e881097c51821b3db6b to your computer and use it in GitHub Desktop.
# Removing HTML Tag from text using regex
# code ref: https://stackoverflow.com/questions/9662346/python-code-to-remove-html-tags-from-a-string
import re
def cleanhtml(raw_html):
cleanr = re.compile('<.*?>')
cleantext = re.sub(cleanr, '', raw_html)
return cleantext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment