-
-
Save anonymous/5eb7d0ebff500337e6f8b3c03fcb55a4 to your computer and use it in GitHub Desktop.
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 bs4 as bs | |
import urllib.request | |
source = urllib.request.urlopen('http://www.nfl.com/big-play-highlights').read() | |
soup = bs.BeautifulSoup(source,'lxml') | |
soup.find_all('h2')[0:5] | |
for url in soup.find_all('loc'): | |
print(url.text) | |
#for url in soup.find_all('a'): | |
# print(url.get('href')) | |
#for url in soup.find_all('loc'): | |
# print(url.text) | |
##used to make requests | |
#import urllib.request | |
# | |
#x = urllib.request.urlopen('http://www.nfl.com/videos') | |
#print(x.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment