Skip to content

Instantly share code, notes, and snippets.

@oxalorg
Created October 23, 2015 10:51
Show Gist options
  • Save oxalorg/22aa580395267e385d8e to your computer and use it in GitHub Desktop.
Save oxalorg/22aa580395267e385d8e to your computer and use it in GitHub Desktop.
import requests
import bs4 as FARHAN
black_page = "http://blacklivesmatter.com/who-we-are/"
res = requests.get(black_page)
res.raise_for_status()
black_file = open('/tmp/blacklivesmatter.txt', 'wb')
for chunk in res.iter_content(100000):
black_file.write(chunk)
black_file.close()
black_file = open('/tmp/blacklivesmatter.txt', 'r')
blackSoup = FARHAN.BeautifulSoup(black_file.read())
blackElement = blackSoup.select('h3')
#print(blackElement)
print("\033[0;31m"+ blackElement[0].getText() + "\n Farhan: blacklivesmatter ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment