roclark / sportsipy

A free sports API written for python
MIT License
475 stars 189 forks source link

Did sports reference completely change their site? #781

Open jchavis06 opened 1 year ago

jchavis06 commented 1 year ago

I am unable to even load boxscore data for the site using this package. Wondering if they completely changed their site's tables?

Was worried this would happen...

1jonahg1 commented 1 year ago

still works for me, using the NFL library.

davidjkrause commented 1 year ago

Which boxscores are you trying to load? Can you give a short example?

jchavis06 commented 1 year ago

Just trying to run the basic example:

from sportsipy.nfl.boxscore import Boxscore

game = Boxscore('202302120phi')
df = game.dataframe

Get this error:

traceback (most recent call last):
  File "/Users/jake/workspace/scripts/testSportsReference.py", line 3, in <module>
    game = Boxscore('202302120phi')
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/sportsipy/nfl/boxscore.py", line 296, in __init__
    self._parse_game_data(uri)
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/sportsipy/nfl/boxscore.py", line 784, in _parse_game_data
    value = self._parse_name(short_field, boxscore)
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/sportsipy/nfl/boxscore.py", line 447, in _parse_name
    return pq(str(boxscore(scheme)).strip())
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/pyquery/pyquery.py", line 212, in __init__
    elements = fromstring(context, self.parser)
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/pyquery/pyquery.py", line 63, in fromstring
    result = getattr(lxml.html, meth)(context)
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/lxml/html/__init__.py", line 873, in fromstring
    doc = document_fromstring(html, parser=parser, base_url=base_url, **kw)
  File "/Users/jake/Library/Python/3.9/lib/python/site-packages/lxml/html/__init__.py", line 761, in document_fromstring
    raise etree.ParserError(
lxml.etree.ParserError: Document is empty

Potentially just a dependency issue? But seems like it is getting an empty document, so figured maybe the site changed. I saw they added a video segment above the games.

davidjkrause commented 1 year ago

For the specific test you are running, the fix on #729 resolved the issue for me. See https://github.com/roclark/sportsipy/issues/729#issuecomment-1180900763

GilbertCherrie commented 1 year ago

@jchavis06 @roclark is this fixed? I am still running into this issue. Seems like no uri are returned from boxscores and boxscore doesn't return any stats either.

davidjkrause commented 1 year ago

As far as I can tell, no one is merging any fixes to this repository for some time. I've got a fork which is updated for newer Python module requirements and includes the fix for #729 as well as others, see https://github.com/davidjkrause/sportsipy

If it doesn't work, you can let me know or file an issue there and I'll take a look.

agentmorris commented 1 year ago

Sites change, so a tool like this will need constant maintenance; adding one vote to make @davidjkrause's repo the new home for sportsipy. Please join this bandwagon, and if enough of us use and star that repo, perhaps we can ask @roclark to point to it in the README of this repo, and maybe transfer PyPI ownership at some point. @davidjkrause, maybe update the README on your repo to indicate that you are at least pulling in new PRs from the original repo, i.e., preferably the top of the README on your repo doesn't also indicate that it's not being maintained?

Go go OSS community ownership.

davidjkrause commented 1 year ago

Sites change, so a tool like this will need constant maintenance; adding one vote to make @davidjkrause's repo the new home for sportsipy. Please join this bandwagon, and if enough of us use and star that repo, perhaps we can ask @roclark to point to it in the README of this repo, and maybe transfer PyPI ownership at some point. @davidjkrause, maybe update the README on your repo to indicate that you are at least pulling in new PRs from the original repo, i.e., preferably the top of the README on your repo doesn't also indicate that it's not being maintained?

Go go OSS community ownership.

Updated the README file on my fork. Willing to take ownership going forward, however that works.

senthilmk commented 11 months ago

Looks like the source data site has changed URI(s) and that seems to be breaking working code.

davidjkrause commented 11 months ago

Looks like the source data site has changed URI(s) and that seems to be breaking working code.

Do you have a specific use case that's failing? As was discussed above, the site does change from time to time, but this repository isn't really updating. If you can share a short sample that's failing for you, I can take a look and possibly fix in my fork.