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
28 stars 19 forks source link

WR Snap % not tracked before 2012 #47

Closed mjk2244 closed 1 year ago

mjk2244 commented 1 year ago

Describe the bug In player_game_log.py, WR game logs currently include offensive snap percentage. However, Pro Football Reference only has snap percentage from the 2012 season onward. As a result, any attempts to get a WR's game log before the 2011 season produces an error.

To Reproduce

from pro_football_reference_web_scraper import player_game_log as p

# this code produces an error
p.get_player_game_log('Julio Jones', 'WR', 2011)

# this code works
p.get_player_game_log('Julio Jones', 'WR', 2012)

Expected behavior We should avoid the error by only tracking snap pct. in WR game logs if the season is >=2012.

Screenshots Julio Jones, 2011:

Screen Shot 2023-05-03 at 1 10 23 PM

Julio Jones, 2012:

Screen Shot 2023-05-03 at 1 10 50 PM

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A

Additional context N/A