Permalink
Browse files

game ranking shows a malformed start tag error ,Planning on preprocce…

…ssing the data or manually parsing :'(
  • Loading branch information...
unknown
unknown committed Mar 4, 2012
1 parent 2309e58 commit e1f3fa07eb2d7c7a006ea050b960b3c4cb38f936
Showing with 265 additions and 194 deletions.
  1. +21 −0 gamerankings.py
  2. +244 −194 ratingagreg.wpu
View
@@ -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
Oops, something went wrong.

0 comments on commit e1f3fa0

Please sign in to comment.