-
Notifications
You must be signed in to change notification settings - Fork 191
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
NFL Boxscore: lxml b'Tag use invalid' #739
Comments
I'm getting the same, Richard. I am trying to seed my NFL database in time for the season start. Sportsipy is an awesome API, and I would love to get this fixed soon.
// lxml.etree.XMLSyntaxError: line 3608: b'Tag use invalid' |
Hey @westaa -> I received a fix in a separate issue: First clone the repo to your local machine and then apply the fix below in the local repo and it should work. I had to pip uninstall the package for it to work correctly. CodeeMcCoderson commented 10 days ago If you navigate to where you have your modules stored on your local machine, find the 'sportsipy' module and got into it. Then go into the 'nfl' module and click on the 'constants.py' scripts. Within that script navigate to line 81 and change this line of code: Next go to line 84 and change this line of code: After changing it, save the script, navigate to your script that was throwing the error and run it again. Let me know if anything was not clear or if it does not work, I will try and help more. |
Sorry for the late reply. Thank you so much for posting this, @RichardSJTotten. I will try this today. |
The above fix initially worked, but now I'm getting a similar issue: lxml.etree.XMLSyntaxError: line 1636: b'Tag use invalid' |
The fix appears to work for all seasons prior to the current 2022 season. |
I'm finding the same to be true. I've applied the fix, uninstalled and reinstalled, etc. Any ideas? Thanks! |
Describe the bug
When attempting to use Boxscore function, I get an error reading:
File "src/lxml/etree.pyx", line 3252, in lxml.etree.fromstring
File "src/lxml/parser.pxi", line 1913, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1793, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1082, in lxml.etree._BaseParser._parseUnicodeDoc
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 663, in lxml.etree._raiseParseError
File "", line 3665
lxml.etree.XMLSyntaxError: line 3665: b'Tag use invalid'
To Reproduce
from sportsipy.nfl.boxscore import Boxscores, Boxscore
game_str = Boxscores(1,2021).games['1-2021'][0]['boxscore']
game_stats = Boxscore(game_str)
Expected behavior
I was expecting the game stats to be returned in JSON format which I could then turn into a dataframe.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: