Skip to content

Commit

Permalink
game ranking shows a malformed start tag error ,Planning on preprocce…
Browse files Browse the repository at this point in the history
…ssing the data or manually parsing :'(
  • Loading branch information
unknown committed Mar 4, 2012
1 parent 2309e58 commit e1f3fa0
Show file tree
Hide file tree
Showing 2 changed files with 265 additions and 194 deletions.
21 changes: 21 additions & 0 deletions gamerankings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
from urllib2 import urlopen
from urlparse import urljoin,urlsplit
from bs4 import BeautifulSoup as bs
from bs4 import SoupStrainer

#for i in range(85):
url="http://www.gamerankings.com/browse.html?page=1"
a=urlopen(url).read()
b=SoupStrainer("table")
soup=bs(a,parseOnlyThese=b)
info=soup.find("table")
#print str(info)
ab=info.ul.li
print str(ab)
while (ab):
name=str(ab.a.findAll("span")[1].h3.contents[0])
rating=str(ab.a.span.contents[0])
type=str(ab.a.findAll("span")[1].span.contents[0])
print name , rating , type
ab=ab.nextSibling.nextSibling
Loading

0 comments on commit e1f3fa0

Please sign in to comment.