-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
game ranking shows a malformed start tag error ,Planning on preprocce…
…ssing the data or manually parsing :'(
- Loading branch information
unknown
committed
Mar 4, 2012
1 parent
2309e58
commit e1f3fa0
Showing
2 changed files
with
265 additions
and
194 deletions.
There are no files selected for viewing
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
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 |
Oops, something went wrong.