DiQ

imdb

DiQ
Aug 8th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. url = 'http://www.imdb.com/chart/top'
  5. r=requests.get(url)
  6. rr=BeautifulSoup(r.content)
  7. x=rr.select('a')
  8. zz=[]
  9. for i in x:
  10.     zz.append(i.get('title'))
  11. for a in zz:
  12.     if a=='Home' or a==None:
  13.         zz.remove(a)
  14. del zz[0:3]
  15. print zz
  16. print len(zz)
Advertisement
Add Comment
Please, Sign In to add comment