Skip to content

Instantly share code, notes, and snippets.

@marshyski
Last active August 29, 2015 14:07
Show Gist options
  • Save marshyski/86e1e949704e9bfa506a to your computer and use it in GitHub Desktop.
Save marshyski/86e1e949704e9bfa506a to your computer and use it in GitHub Desktop.
Example of Python requests & BeauitfulSoup with no HTML tags
#!/usr/bin/python
import requests
from bs4 import BeautifulSoup
import json
q = requests.get('http://marshyski.com/man-behind-the-keyboard')
def cleanhtml():
return ''.join(BeautifulSoup(q.text).findAll(text=True)).replace(' ', ' ')
print cleanhtml()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment