Created
February 7, 2019 00:04
-
-
Save pdbartsch/72cd4d0b55c5a40114372bdbe5049d7b to your computer and use it in GitHub Desktop.
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
import requests | |
from bs4 import BeautifulSoup | |
url = 'https://www.nytimes.com/' | |
result = requests.get(url) | |
c = result.content | |
soup = BeautifulSoup(c) | |
heading = soup.find_all('h2') | |
for story in heading: | |
print(story.text.strip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment