spinach / fantasypremierleague.py Goto Github PK
View Code? Open in Web Editor NEW⚽ Statistics for your mini leagues.
⚽ Statistics for your mini leagues.
File "playersPickedInLeague.py", line 133
except Exception, e:
^
SyntaxError: invalid syntax
Sometimes following error occurs
classic league mode
Errors occurred in getting entries/managers in the league.
'standings'
Traceback (most recent call last):
File "playersPickedInLeague.py", line 112, in <module>
entries = getUserEntryIds(leagueIdSelected, pageCount, leagueStandingUrl)
File "playersPickedInLeague.py", line 35, in getUserEntryIds
managers = jsonResponse["standings"]["results"]
KeyError: 'standings'
Its because of authorization error in new django api
i tried this link:https://medium.com/@bram.vanherle1/fantasy-premier-league-api-authentication-guide-2f7aeb2382e4
but it didn't worked for me
For now you need open those link from your browser including the next page thats empty
Thank you for a great project for us FPL geeks!
I have an idea for further development, but my skills are lacking.
Would it be possible to tweak the script to output a file containing what players each manager selected, if the player was on the field/benched, and who was captained/VC?
Got SSL Error while running the script fom MAC; Any idea:
Traceback (most recent call last):
File "playersPickedInLeague.py", line 82, in <module>
getPlayersInfo()
File "playersPickedInLeague.py", line 20, in getPlayersInfo
r = requests.get(PLAYERS_INFO_URL, verify=False)
File "/Library/Python/2.7/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='fantasy.premierleague.com', port=443): Max retries exceeded with url: /drf/bootstrap-static (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
~
It calculates the data for only 1st page in case of classic league. Is there a way to calculate for the remaining pages?
Hi mate, thanks for this code. I've used it for a while now with plotly & bokeh. Just wanted to mention (in case you weren't aware) the API has changed. At the minute, the classic league URL looks like this:
https://fantasy.premierleague.com/api/leagues-classic/10529/standings/?page_new_entries=1&page_standings=1
and the H2H URL:
https://fantasy.premierleague.com/api/leagues-h2h/213672/standings/?page_new_entries=1&page_standings=1
hope this helps.
I'm using Python 3 and I get the following problem
File "playersPickedInLeague.py", line 134
print str(e)
^
SyntaxError: invalid syntax
File "playersPickedInLeague.py", line 134
print str(e)
^
SyntaxError: invalid syntax
Hey there,
I've tried with both Python 2 & Python 3 and when I run the command as indicated in the Readme file I receive the following error:
Traceback (most recent call last):
File "playersPickedInLeague.py", line 87, in <module>
for element in allPlayers["elements"]:
KeyError: 'elements'
Appreciate your help and many thanks for developing it!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.