Skip to content

Instantly share code, notes, and snippets.

@nuryslyrt
Last active July 19, 2017 15:53
Show Gist options
  • Save nuryslyrt/2da056c22d99c4fc34b63d67f704491d to your computer and use it in GitHub Desktop.
Save nuryslyrt/2da056c22d99c4fc34b63d67f704491d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#Regex Example:
import re
def cleanhtml(raw_html):
cleanr = re.compile('<.*?>')
cleantext = re.sub(cleanr, '', raw_html)
return cleantext
#BeautifulSoup Example:
from BeautifulSoup import BeautifulSoup
cleantext = BeautifulSoup(raw_html).text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment