question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NFL Boxscore: Document is Empty

See original GitHub issue

Describe 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

image image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

5reactions
CodeeMcCodersoncommented, Jul 14, 2022

@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.

0reactions
ericmk52commented, Oct 23, 2022

@CodeeMcCoderson It looks like this patch works for previous games that have already been played, but I am still getting this DocumentEmpty error for any games that have not been played yet

The fix appears to work for all seasons prior to the current 2022 season.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found