Last active
August 29, 2015 14:07
-
-
Save marshyski/86e1e949704e9bfa506a to your computer and use it in GitHub Desktop.
Example of Python requests & BeauitfulSoup with no HTML tags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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