Created
November 8, 2017 07:11
-
-
Save Sparrow1029/598ffcfa1ef8e80e0223cc5ef445f3f7 to your computer and use it in GitHub Desktop.
Python Practice 19 - Decode a web page [Sparrow1029]
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
from bs4 import BeautifulSoup | |
from pprint import pprint | |
r = \ | |
requests.get('http://www.vanityfair.com/society/2014/06/monica-lewinsky-humiliation-culture') | |
soup = BeautifulSoup(r.text, "lxml") | |
p_tags = soup.find_all("p") | |
for i in p_tags: | |
print(pprint(i.text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment