Created
August 18, 2017 14:13
-
-
Save anonymous/7a8419748960a2bf3008a62a4dbe040b to your computer and use it in GitHub Desktop.
Scrape the top 10k overall FPL
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
import json | |
import requests | |
#ID for the overall global league | |
league_id = 313 | |
page = 1 | |
#Do 200 pages to get top 10k (50 teams/page) | |
while page <= 200: | |
URL="https://fantasy.premierleague.com/drf/leagues-classic-standings/{}?phase=1&ls-page={}".format(str(league_id),str(page)) | |
data = requests.get(URL).json() | |
for t in data['standings']['results']: | |
print t['id'] | |
page += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment