Created
August 1, 2017 14:30
-
-
Save rostyq/7dc20843a3cb24a86e2a61727e90df4b to your computer and use it in GitHub Desktop.
Exercise on http://www.practicepython.org
This file contains 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 as bs | |
url = "https://www.vanityfair.com/style/society/2014/06/monica-lewinsky-humiliation-culture" | |
# get page and make soup for parsing | |
soup = bs(requests.get(url).text, "html5lib") | |
# select all tag p in tag section | |
article = soup.select('section p') | |
for i in article: | |
print(i.text, end='\n\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment