mjk2244 / pro-football-reference-web-scraper

Web scraper to retrieve player and team data from Pro Football Reference.
https://mjk2244.github.io/pro-football-reference-web-scraper/
Apache License 2.0
29 stars 20 forks source link

team_game_log crashes attempting to parse games where one of the teams has 0 passing yards #52

Open astronautlevel2 opened 1 year ago

astronautlevel2 commented 1 year ago

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:

  1. 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):

Additional context Add any other context about the problem here.

mjk2244 commented 1 year ago

Ha, I didn't even think to check for that. Thanks for raising, I'll try to find time to fix later this week and publish a release