Skip to content

Instantly share code, notes, and snippets.

@y1n0
Created March 19, 2017 15:23
Show Gist options
  • Select an option

  • Save y1n0/daaf129add44c4f41dc1c11196309e3d to your computer and use it in GitHub Desktop.

Select an option

Save y1n0/daaf129add44c4f41dc1c11196309e3d to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup(requests.get('http://nytimes.com').content, 'html.parser')
for i in soup(class_='story-heading'):
print(i.text.strip())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment