Skip to content

Instantly share code, notes, and snippets.

@atvKumar
Created May 31, 2014 04:50
Show Gist options
  • Save atvKumar/6f5383d43794c3df08d1 to your computer and use it in GitHub Desktop.
Save atvKumar/6f5383d43794c3df08d1 to your computer and use it in GitHub Desktop.
Use Requests and Beautiful Soup to Scrap for data
__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