Created
May 31, 2014 04:50
-
-
Save atvKumar/6f5383d43794c3df08d1 to your computer and use it in GitHub Desktop.
Use Requests and Beautiful Soup to Scrap for data
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
__author__ = 'kumar' | |
from bs4 import BeautifulSoup | |
import requests | |
page = requests.get('http://www.imdb.com/chart/?ref_=nv_ch_cht_2%3F') | |
soup = BeautifulSoup(page.text) | |
for x in soup.find_all('td', {"class": "ratingColumn"}): | |
y = x.find_all('span') | |
try: | |
print y[0].text | |
except IndexError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment