NFL Boxscore: Document is Empty
See original GitHub issueDescribe the bug Trying to pull boxscores for the 2021 NFL season and result is error saying “Document is empty”
To Reproduce Sample code which causes an issue.
!pip install sportsipy
from sportsipy.nfl.boxscore import Boxscores, Boxscore
game_str = Boxscores(7,2021).games['7-2021'][0]['boxscore']
game_stats = Boxscore(game_str)
game_stats.dataframe
Expected behavior would like to see the boxscores of the games played week 7 of the 2021 season
software Using Google Colab on Chrome
Issue Analytics
- State:
- Created a year ago
- Comments:11
Top Results From Across the Web
NFL Package — sportsipy 0.1.0 documentation - Read the Docs
The NFL package offers multiple modules which can be used to retrieve information and statistics for the National Football League, such as team...
Read more >Stats Articles | NFL Football Operations
The 2020 regular season has seen NFL games played in empty stadiums, or in front of significantly reduced crowds. The lack of home...
Read more >NFL Data API Developer Portal - SportsDataIO
NFL API giving you scores, odds, projections, stats, news, and images. ... This is the documentation for SportsDataIO's NFL API. All of our...
Read more >Printable Super Bowl Squares - 100 Square Grid Office Pool
Print NFL Super Bowl Boxes Template. Printable Football Square Board Box Pool. Free Super Bowl Sheets for your Office Pool or Super Bowl...
Read more >NFL Widgets | Sportradar US API Portal
Boxscore. us.match.nfl.boxScore provides a structured summary of team totals and ... Valid options are regular , preseason , probowl or an empty value...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@RichardSJTotten to fix the problem that I had, which seems almost identical to yours, is I changed the sportsipy module directly on my hard drive. I did not pull down the fix that I posted earlier.
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: ‘home_name’: ‘a[itemprop=“name”]:first’, To this: ‘home_name’: ‘div[class=“linescore_wrap”] table tbody tr:last td:nth-child(2)’,
Next go to line 84 and change this line of code: ‘away_name’: ‘a[itemprop=“name”]:last’, To this: ‘away_name’: ‘div[class=“linescore_wrap”] table tbody tr:first td:nth-child(2)’,
After changing it, save the script, navigate to your script that was throwing the error and run it again. It should work.
Let me know if anything was not clear or if it does not work, I will try and help more.
The fix appears to work for all seasons prior to the current 2022 season.