Skip to content

Commit

Permalink
Fork of code from ScraperWiki at https://classic.scraperwiki.com/scra…
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphg85 committed Jul 13, 2015
0 parents commit 69b3adf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
# Ignore output of scraper
data.sqlite
1 change: 1 addition & 0 deletions README.textile
@@ -0,0 +1 @@
Downloads information Fantasy Football player information on a weekly basis from premierleague.com.
13 changes: 13 additions & 0 deletions scraper.py
@@ -0,0 +1,13 @@
import scraperwiki
import json
from datetime import date

for i in range(1,1000):
try:
jsonPage = scraperwiki.scrape('http://fantasy.premierleague.com/web/api/elements/%d/'%(i))
playerObj = json.loads(jsonPage)
table_name = 'data' + str(date.today())
scraperwiki.sqlite.save(unique_keys=['id'], data=playerObj, table_name=table_name)
except:
print 'Stopped at %d'%(i)
break

0 comments on commit 69b3adf

Please sign in to comment.