Skip to content

Instantly share code, notes, and snippets.

@ch7ck
Created November 22, 2016 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ch7ck/0b2ec85c0ddb876bc2dc01897ef83390 to your computer and use it in GitHub Desktop.
Save ch7ck/0b2ec85c0ddb876bc2dc01897ef83390 to your computer and use it in GitHub Desktop.
Grab top 30 HN Titles
#!/usr/bin/python
#TODO
import requests
from bs4 import BeautifulSoup
r = requests.get('http://news.ycombinator.com')
soup = BeautifulSoup(r.text, 'lxml')
linkList = soup.find_all('a', {'class': 'storylink'})
for link in linkList:
print link.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment