Git Product home page Git Product logo

Comments (5)

amosbastian avatar amosbastian commented on May 28, 2024

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.

becjacky avatar becjacky commented on May 28, 2024

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.

amosbastian avatar amosbastian commented on May 28, 2024

Try removing the options ({"h": {"id": "89", "title": "Manchester United", "short_title": "MUN"}}) and see if it returns anything.

from understat.

becjacky avatar becjacky commented on May 28, 2024

Thanks for response! After removing the block you mentioned above, I still got an empty list. Upset!

from understat.

amosbastian avatar amosbastian commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.