player_game_log.py currently cannot accommodate players who have names similar to other players. The current functionality assumes that a player's game log can be found at the following url: https://www.pro-football-reference.com/players//00/gamelog//. However, players with names similar to other players may have a different url.
In the case of Josh Allen, a potential solution may be to go to https://www.pro-football-reference.com/players/A/ and retrieve the href for the correct Josh Allen. Analogous steps could also be taken for other names.
player_game_log.py currently cannot accommodate players who have names similar to other players. The current functionality assumes that a player's game log can be found at the following url: https://www.pro-football-reference.com/players//00/gamelog//. However, players with names similar to other players may have a different url.
For example, the game log of Josh Allen (current Buffalo Bills QB) can be found at the following url: https://www.pro-football-reference.com/players/A/AlleJo02/gamelog/2022/. "AlleJo00" belongs to a different player named Josh Allen. There are countless other examples, including Damien Harris (https://www.pro-football-reference.com/players/H/HarrDa06.htm), Christian McCafrrey (https://www.pro-football-reference.com/players/M/McCaCh01.htm) and Davante Adams (https://www.pro-football-reference.com/players/A/AdamDa01.htm). As a result, the wrong pages are being scraped in cases like these.
In the case of Josh Allen, a potential solution may be to go to https://www.pro-football-reference.com/players/A/ and retrieve the href for the correct Josh Allen. Analogous steps could also be taken for other names.