[GH-ISSUE #779] [FBref] Add support for scraping detailed player information #163

Open
opened 2026-03-02 15:56:19 +03:00 by kerem · 3 comments
Owner

Originally created by @baniasbaabe on GitHub (Jan 2, 2025).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/779

Retrieving more information about a specific player like club history would be nice!

Originally created by @baniasbaabe on GitHub (Jan 2, 2025). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/779 Retrieving more information about a specific player like club history would be nice!
Author
Owner

@babu-akhil commented on GitHub (Feb 9, 2025):

I'd be willing to work on this.

@probberechts On the implementation for this, I am thinking to implement a function like fbref.read_player_club_history(player_id) with using player_id like '507c7bdf' (https://fbref.com/en/players/507c7bdf/ links to Bruno Fernandes). Would this be a good approach?

Or do you think it is better to have more abstractions like fbref_player classes which can then have multiple functions for scraping for the various information on the player page , none of which are supported right now.

<!-- gh-comment-id:2646310435 --> @babu-akhil commented on GitHub (Feb 9, 2025): I'd be willing to work on this. @probberechts On the implementation for this, I am thinking to implement a function like fbref.read_player_club_history(player_id) with using player_id like '507c7bdf' (https://fbref.com/en/players/507c7bdf/ links to Bruno Fernandes). Would this be a good approach? Or do you think it is better to have more abstractions like fbref_player classes which can then have multiple functions for scraping for the various information on the player page , none of which are supported right now.
Author
Owner

@probberechts commented on GitHub (Feb 9, 2025):

The issue here is that the FBref class should be initialized with a league and season. All functions in that class than only return data for the given league and season. This is not desirable when you scrape a player's club history. Therefore, I think a better solution would be to add a FBrefPlayer class.

<!-- gh-comment-id:2646563960 --> @probberechts commented on GitHub (Feb 9, 2025): The issue here is that the `FBref` class should be initialized with a league and season. All functions in that class than only return data for the given league and season. This is not desirable when you scrape a player's club history. Therefore, I think a better solution would be to add a `FBrefPlayer` class.
Author
Owner

@babu-akhil commented on GitHub (May 14, 2025):

I was trying to work on this -

but the tests are failing on my fork without any changes

======================================================================================== short test summary info =========================================================================================
FAILED tests/test_FiveThirtyEight.py::test_read_leagues - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)
FAILED tests/test_FiveThirtyEight.py::test_read_games - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)
FAILED tests/test_FiveThirtyEight.py::test_read_forecasts - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)
FAILED tests/test_FiveThirtyEight.py::test_read_clinches - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)
FAILED tests/test_FiveThirtyEight.py::test_filter_leagues - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)
FAILED tests/test_SoFIFA.py::test_read_team_ratings - IndexError: list index out of range
<!-- gh-comment-id:2880866763 --> @babu-akhil commented on GitHub (May 14, 2025): I was trying to work on this - but the tests are failing on my fork without any changes ``` ======================================================================================== short test summary info ========================================================================================= FAILED tests/test_FiveThirtyEight.py::test_read_leagues - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9) FAILED tests/test_FiveThirtyEight.py::test_read_games - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9) FAILED tests/test_FiveThirtyEight.py::test_read_forecasts - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9) FAILED tests/test_FiveThirtyEight.py::test_read_clinches - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9) FAILED tests/test_FiveThirtyEight.py::test_filter_leagues - json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9) FAILED tests/test_SoFIFA.py::test_read_team_ratings - IndexError: list index out of range ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#163
No description provided.