[GH-ISSUE #604] [FBref] HTTP error 500 reading team match stats for current and past seasons, many leagues #112

Closed
opened 2026-03-02 15:55:53 +03:00 by kerem · 4 comments
Owner

Originally created by @martinwilliamsiet on GitHub (Jun 8, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/604

Hi!

I'm using Python 3.11.9 and soccerdata version 1.7.1.

The following code is returning "HTTPError: 500 Server Error: Internal Server Error"

ARGstats = sd.FBref(leagues="ARG-ArgentinePrimeraDivisión", seasons='2324')
ARGteamMatchMisc = ARGstats.read_team_match_stats(stat_type="misc")

err500sd

Same issue for other leagues, big 5 included, and with different stat types.

It appears that the URL that is being requested (https://fbref.com/en/squads/4bee7ba3/2023-2024/matchlogs/all_comps/misc) is incorrect for only team match stats, (https://fbref.com/en/squads/4bee7ba3/2024/matchlogs/all_comps/misc) also doesn't work for current season, but (https://fbref.com/en/squads/4bee7ba3/2023/matchlogs/all_comps/misc) and previous years, with just one year listed in link after squad identifier, all appear to open the correct page.

Thanks in advance!

Edit: I have set up start and end months for all leagues in league dictionary correctly.

Originally created by @martinwilliamsiet on GitHub (Jun 8, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/604 Hi! I'm using Python 3.11.9 and soccerdata version 1.7.1. The following code is returning "HTTPError: 500 Server Error: Internal Server Error" ``` ARGstats = sd.FBref(leagues="ARG-ArgentinePrimeraDivisión", seasons='2324') ARGteamMatchMisc = ARGstats.read_team_match_stats(stat_type="misc") ``` ![err500sd](https://github.com/probberechts/soccerdata/assets/151815488/3f968705-3f98-4709-9d0c-82a8915b77ae) Same issue for other leagues, big 5 included, and with different stat types. It appears that the URL that is being requested (https://fbref.com/en/squads/4bee7ba3/2023-2024/matchlogs/all_comps/misc) is incorrect for only team match stats, (https://fbref.com/en/squads/4bee7ba3/2024/matchlogs/all_comps/misc) also doesn't work for current season, but (https://fbref.com/en/squads/4bee7ba3/2023/matchlogs/all_comps/misc) and previous years, with just one year listed in link after squad identifier, all appear to open the correct page. Thanks in advance! Edit: I have set up start and end months for all leagues in league dictionary correctly.
kerem 2026-03-02 15:55:53 +03:00
Author
Owner

@Gabrynho commented on GitHub (Jun 13, 2024):

I'm facing the same problem scraping MLS data from the last 4 seasons, I can obtain the first 3 seasons correctly, but the current one raises the same error for every feature (stat_type) and I don't know how to fix it either.

<!-- gh-comment-id:2165257837 --> @Gabrynho commented on GitHub (Jun 13, 2024): I'm facing the same problem scraping MLS data from the last 4 seasons, I can obtain the first 3 seasons correctly, but the current one raises the same error for every feature (stat_type) and I don't know how to fix it either.
Author
Owner

@probberechts commented on GitHub (Jun 14, 2024):

Note that the Argentinian league and MLS are not supported. If you want to scrape data for these leagues, it is up to you to adapt the code accordingly.

It seems to work fine for the big five leagues, both for the current and previous seasons.

import soccerdata as sd
fbref = sd.FBref("ENG-Premier League", [2223, 2324], no_cache=True)
fbref.read_team_match_stats(team="Manchester City")
<!-- gh-comment-id:2168196314 --> @probberechts commented on GitHub (Jun 14, 2024): Note that the Argentinian league and MLS are not supported. If you want to scrape data for these leagues, it is up to you to adapt the code accordingly. It seems to work fine for the big five leagues, both for the current and previous seasons. ```py import soccerdata as sd fbref = sd.FBref("ENG-Premier League", [2223, 2324], no_cache=True) fbref.read_team_match_stats(team="Manchester City") ```
Author
Owner

@probberechts commented on GitHub (Jun 16, 2024):

This might have been fixed as a side effect of #613.

<!-- gh-comment-id:2171770289 --> @probberechts commented on GitHub (Jun 16, 2024): This might have been fixed as a side effect of #613.
Author
Owner

@martinwilliamsiet commented on GitHub (Jun 18, 2024):

Thanks! I attempted to fork and fix on my own but it caused 429 errors and was in the middle of figuring out why that happened. I am concatenating dataframes and pulling data from it and it may have been too much to handle with the source change. I'm unsure how to send you what I did, merging did not work for me. I will try again soon, thank you for the fix!

<!-- gh-comment-id:2174657433 --> @martinwilliamsiet commented on GitHub (Jun 18, 2024): Thanks! I attempted to fork and fix on my own but it caused 429 errors and was in the middle of figuring out why that happened. I am concatenating dataframes and pulling data from it and it may have been too much to handle with the source change. I'm unsure how to send you what I did, merging did not work for me. I will try again soon, thank you for the fix!
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#112
No description provided.