pro-football-reference-web-scraper
pro-football-reference-web-scraper copied to clipboard
team_game_log crashes attempting to parse games where one of the teams has 0 passing yards
Describe the bug
When a team has exactly 0 passing yards in a game, PFR reports it as an empty string in the table, which causes team_game_log to crash when attempting to cast that empty string to an integer with ValueError: invalid literal for int() with base 10: ''
To Reproduce Steps to reproduce the behavior:
- Attempt to call get_team_game_log with a team/year in which one of the teams had a passing yards of 0. An example game would be week 17 of the Oakland Raiders's 2003 Season, in which they had 0 passing yards vs the Chargers.
Expected behavior The program should check for an empty string (possibly for any stat? score has 0 reported, but other stats such as turnovers have an empty string when the value is 0 in PFR) and treat these cases as being 0
Desktop (please complete the following information):
- OS: Windows 11
Additional context Add any other context about the problem here.