Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did sports reference completely change their site? #781

Open
jchavis06 opened this issue Apr 6, 2023 · 10 comments
Open

Did sports reference completely change their site? #781

jchavis06 opened this issue Apr 6, 2023 · 10 comments

Comments

@jchavis06
Copy link

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
Copy link

1jonahg1 commented Apr 7, 2023

still works for me, using the NFL library.

@davidjkrause
Copy link

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

@jchavis06
Copy link
Author

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
Copy link

For the specific test you are running, the fix on #729 resolved the issue for me. See #729 (comment)

@GilbertCherrie
Copy link

@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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@davidjkrause
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants