Comments (5)
I guess you are using a Jupyter notebook or something like that?
If so, then try this:
import nest_asyncio
nest_asyncio.apply()
from understat.
Sorry for not specifying my working console! I'm running the code in Jupyter notebook on windows system indeed! Now I change the code but get an empty list:
import nest_asyncio
import json
import aiohttp
from understat import Understat
nest_asyncio.apply()
async def main():
async with aiohttp.ClientSession() as session:
understat = Understat(session)
fixtures = await understat.get_league_fixtures(
"epl",
2018,
{
"h": {"id": "89",
"title": "Manchester United",
"short_title": "MUN"}
}
)
print(json.dumps(fixtures))
loop1 = asyncio.get_event_loop()
loop1.run_until_complete(main())
I don't know where the problem come from. :D
from understat.
Try removing the options ({"h": {"id": "89", "title": "Manchester United", "short_title": "MUN"}}
) and see if it returns anything.
from understat.
Thanks for response! After removing the block you mentioned above, I still got an empty list. Upset!
from understat.
Sorry for the late reply, I thought I had already replied. Fixtures are matches yet to be played (2018 season is in the past), so you should use get_league_results
instead.
from understat.
Related Issues (15)
- Pulling Match Events Other Than Goals HOT 4
- Apply filters on tables HOT 1
- Pull additional data for each match HOT 5
- UnboundLocalError
- Possible to filter get_team_players result by date/game week? HOT 1
- feat: Building Conda Packages
- ci: Create Basic CI/CD pipeline using Github Actions
- 'NoneType' object has no attribute 'group' HOT 5
- Example in the readme is not working HOT 1
- Possible issue on Anaconda HOT 4
- Replace BeautifulSoup with lxml or similar
- Tests don't all pass off-season HOT 1
- Only last week HOT 3
- error messages HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from understat.