[GH-ISSUE #166] [FBRef] - Custom League not loading. #40

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

Originally created by @OnlineAnalytics on GitHub (Feb 21, 2023).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/166

{
  "ENG-Premier League": {
      "ClubElo": "ENG_1",
      "MatchHistory": "E0",
      "FiveThirtyEight": "premier-league",
      "FBref": "Premier League",
      "ESPN": "eng.1",
      "SoFIFA": "English Premier League (1)",
      "WhoScored": "England - Premier League",
      "season_start": "Aug",
      "season_end": "May"
  },
  "ESP-La Liga": {
      "ClubElo": "ESP_1",
      "MatchHistory": "SP1",
      "FiveThirtyEight": "la-liga",
      "FBref": "La Liga",
      "ESPN": "esp.1",
      "SoFIFA": "Spain Primera Division (1)",
      "WhoScored": "Spain - LaLiga"
  },
  "ITA-Serie A": {
      "ClubElo": "ITA_1",
      "MatchHistory": "I1",
      "FiveThirtyEight": "serie-a",
      "FBref": "Serie A",
      "ESPN": "ita.1",
      "SoFIFA": " Italian Serie A (1)",
      "WhoScored": "Italy - Serie A",
      "season_start": "Aug",
      "season_end": "May"
  },
  "GER-Bundesliga": {
      "ClubElo": "GER_1",
      "MatchHistory": "D1",
      "FiveThirtyEight": "bundesliga",
      "FBref": "Fußball-Bundesliga",
      "ESPN": "ger.1",
      "SoFIFA": "German 1. Bundesliga (1)",
      "WhoScored": "Germany - Bundesliga",
      "season_start": "Aug",
      "season_end": "May"
  },
  "FRA-Ligue 1": {
      "ClubElo": "FRA_1",
      "MatchHistory": "F1",
      "FiveThirtyEight": "ligue-1",
      "FBref": "Ligue 1",
      "ESPN": "fra.1",
      "SoFIFA": "French Ligue 1 (1)",
      "WhoScored": "France - Ligue 1",
      "season_start": "Aug",
      "season_end": "May"
  },
  "EFL Championship": {
      "FBref": "EFL Championship",
      "season_start": "Aug",
      "season_end": "May"
  },
  "NED-Eredivisie": {
      "ClubElo": "NED_1",
      "MatchHistory": "N1",
      "SoFIFA": "Holland Eredivisie (1)",
      "FBref": "Dutch Eredivisie",
      "ESPN": "ned.1",
      "FiveThirtyEight": "eredivisie",
      "WhoScored": "Netherlands - Eredivisie",
      "season_start": "Aug",
      "season_end": "May"
  },
 "ARG-Liga Profesional": {
      "WhoScored":"Argentina - Liga Profesional",
      "FBref":"Argentina-Primera-Division"
  },
  "ESP-Liga F": {
      "FBref": "Liga F"
  }
}    

The above is my custom league json.
I'm having issues reading anything from FBRef though in regards to Liga F. Liga F looks to be fully supported, all the stats, schedule etc. But I get an error saying No objects to concentate, when using the code;

fbref = sd.FBref(leagues=['ESP-Liga F'])

fbref.read_schedule()
Originally created by @OnlineAnalytics on GitHub (Feb 21, 2023). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/166 ```json { "ENG-Premier League": { "ClubElo": "ENG_1", "MatchHistory": "E0", "FiveThirtyEight": "premier-league", "FBref": "Premier League", "ESPN": "eng.1", "SoFIFA": "English Premier League (1)", "WhoScored": "England - Premier League", "season_start": "Aug", "season_end": "May" }, "ESP-La Liga": { "ClubElo": "ESP_1", "MatchHistory": "SP1", "FiveThirtyEight": "la-liga", "FBref": "La Liga", "ESPN": "esp.1", "SoFIFA": "Spain Primera Division (1)", "WhoScored": "Spain - LaLiga" }, "ITA-Serie A": { "ClubElo": "ITA_1", "MatchHistory": "I1", "FiveThirtyEight": "serie-a", "FBref": "Serie A", "ESPN": "ita.1", "SoFIFA": " Italian Serie A (1)", "WhoScored": "Italy - Serie A", "season_start": "Aug", "season_end": "May" }, "GER-Bundesliga": { "ClubElo": "GER_1", "MatchHistory": "D1", "FiveThirtyEight": "bundesliga", "FBref": "Fußball-Bundesliga", "ESPN": "ger.1", "SoFIFA": "German 1. Bundesliga (1)", "WhoScored": "Germany - Bundesliga", "season_start": "Aug", "season_end": "May" }, "FRA-Ligue 1": { "ClubElo": "FRA_1", "MatchHistory": "F1", "FiveThirtyEight": "ligue-1", "FBref": "Ligue 1", "ESPN": "fra.1", "SoFIFA": "French Ligue 1 (1)", "WhoScored": "France - Ligue 1", "season_start": "Aug", "season_end": "May" }, "EFL Championship": { "FBref": "EFL Championship", "season_start": "Aug", "season_end": "May" }, "NED-Eredivisie": { "ClubElo": "NED_1", "MatchHistory": "N1", "SoFIFA": "Holland Eredivisie (1)", "FBref": "Dutch Eredivisie", "ESPN": "ned.1", "FiveThirtyEight": "eredivisie", "WhoScored": "Netherlands - Eredivisie", "season_start": "Aug", "season_end": "May" }, "ARG-Liga Profesional": { "WhoScored":"Argentina - Liga Profesional", "FBref":"Argentina-Primera-Division" }, "ESP-Liga F": { "FBref": "Liga F" } } ``` The above is my custom league json. I'm having issues reading anything from FBRef though in regards to ```Liga F```. Liga F looks to be fully supported, all the stats, schedule etc. But I get an error saying ```No objects to concentate```, when using the code; ``` fbref = sd.FBref(leagues=['ESP-Liga F']) fbref.read_schedule() ```
kerem closed this issue 2026-03-02 15:55:16 +03:00
Author
Owner

@probberechts commented on GitHub (Feb 21, 2023):

Did you check these three points: https://github.com/probberechts/soccerdata/issues/104#issuecomment-1327333924?

<!-- gh-comment-id:1439004553 --> @probberechts commented on GitHub (Feb 21, 2023): Did you check these three points: https://github.com/probberechts/soccerdata/issues/104#issuecomment-1327333924?
Author
Owner

@OnlineAnalytics commented on GitHub (Feb 21, 2023):

Yes, I checked the points -
image
and it's available in the leagues
and I also reloaded the sd module too.

<!-- gh-comment-id:1439009285 --> @OnlineAnalytics commented on GitHub (Feb 21, 2023): Yes, I checked the points - ![image](https://user-images.githubusercontent.com/116591933/220444011-1e078743-ab36-416f-800f-d11ee8b1002c.png) and it's available in the leagues and I also reloaded the sd module too.
Author
Owner

@probberechts commented on GitHub (Feb 21, 2023):

I've literally copy-pasted your code and it works fine. Maybe try fbref = sd.FBref(leagues=['ESP-Liga F'], no_cache=True).

<!-- gh-comment-id:1439019269 --> @probberechts commented on GitHub (Feb 21, 2023): I've literally copy-pasted your code and it works fine. Maybe try `fbref = sd.FBref(leagues=['ESP-Liga F'], no_cache=True)`.
Author
Owner

@OnlineAnalytics commented on GitHub (Feb 21, 2023):

Strange. I'm running the exact code you are, and receiving the same error. Tried it with tor incase that was the issue and I had

[02/21/23 20:05:37] ERROR    Error while scraping https://fbref.com/en/comps/. Retrying... (attempt  [_common.py](file:///C:/Users/James/AppData/Local/Programs/Python/Python310/lib/site-packages/soccerdata/_common.py):[342](file:///C:/Users/James/AppData/Local/Programs/Python/Python310/lib/site-packages/soccerdata/_common.py#342)
                             1 of 5).                                                                              
                             Traceback (most recent call last):                                                    
                               File                                                                                
                             "C:\Users\James\AppData\Local\Programs\Python\Python310\lib\site-packag               
                             es\soccerdata\_common.py", line 336, in _download_and_save                            
                                 response.raise_for_status()                                                       
                               File                                                                                
                             "C:\Users\James\AppData\Roaming\Python\Python310\site-packages\requests               
                             \models.py", line 1021, in raise_for_status                                           
                                 raise HTTPError(http_error_msg, response=self)                                    
                             requests.exceptions.HTTPError: 403 Client Error: Forbidden for url:                   
                             https://fbref.com/en/comps/

error.

I'm going to try it in VSCode instead of Jupyter lab and see if that changes.

Edit: Same issue in VSCode too.

<!-- gh-comment-id:1439031095 --> @OnlineAnalytics commented on GitHub (Feb 21, 2023): Strange. I'm running the exact code you are, and receiving the same error. Tried it with tor incase that was the issue and I had ``` [02/21/23 20:05:37] ERROR Error while scraping https://fbref.com/en/comps/. Retrying... (attempt [_common.py](file:///C:/Users/James/AppData/Local/Programs/Python/Python310/lib/site-packages/soccerdata/_common.py):[342](file:///C:/Users/James/AppData/Local/Programs/Python/Python310/lib/site-packages/soccerdata/_common.py#342) 1 of 5). Traceback (most recent call last): File "C:\Users\James\AppData\Local\Programs\Python\Python310\lib\site-packag es\soccerdata\_common.py", line 336, in _download_and_save response.raise_for_status() File "C:\Users\James\AppData\Roaming\Python\Python310\site-packages\requests \models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://fbref.com/en/comps/ ``` error. I'm going to try it in VSCode instead of Jupyter lab and see if that changes. Edit: Same issue in VSCode too.
Author
Owner

@OnlineAnalytics commented on GitHub (Feb 21, 2023):

Other leagues work for me, like ESP-La Liga. just seems to be ESP-Liga F I'm struggling with.

<!-- gh-comment-id:1439079744 --> @OnlineAnalytics commented on GitHub (Feb 21, 2023): Other leagues work for me, like ESP-La Liga. just seems to be ESP-Liga F I'm struggling with.
Author
Owner

@OnlineAnalytics commented on GitHub (Feb 21, 2023):

Restarted my Laptop and it worked! Totally random that. Thanks for your help.

<!-- gh-comment-id:1439097902 --> @OnlineAnalytics commented on GitHub (Feb 21, 2023): Restarted my Laptop and it worked! Totally random that. Thanks for your help.
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#40
No description provided.