[GH-ISSUE #63] [FBref] 403 client error #8

Closed
opened 2026-03-02 15:54:58 +03:00 by kerem · 2 comments
Owner

Originally created by @clumsycompiler on GitHub (Jul 18, 2022).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/63

Steps to recreate the problem:

import soccerdata as sd
fbref = sd.FBref(leagues="ENG-Premier League", seasons=2021)
team_season_stats = fbref.read_team_season_stats(stat_type="standard")
team_season_stats.head()

Error:

[07/18/22 09:33:53] ERROR Error while scraping https://fbref.com/en/comps/. _common.py:349
Retrying... (attempt 1 of 5).
Traceback (most recent call last):
File "/home/dkblu/anaconda3/envs/sportsdata/lib/python3.9/site-packages/soccerdata/_common.py",
line 343, in _download_and_save
return io.BytesIO(response.content)
File "/home/dkblu/anaconda3/envs/sportsdata/lib/python3.9/site-packages/requests/models.py",
line 960,
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/

Originally created by @clumsycompiler on GitHub (Jul 18, 2022). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/63 Steps to recreate the problem: import soccerdata as sd fbref = sd.FBref(leagues="ENG-Premier League", seasons=2021) team_season_stats = fbref.read_team_season_stats(stat_type="standard") team_season_stats.head() Error: [07/18/22 09:33:53] ERROR Error while scraping https://fbref.com/en/comps/. _common.py:349 Retrying... (attempt 1 of 5). Traceback (most recent call last): File "/home/dkblu/anaconda3/envs/sportsdata/lib/python3.9/site-packages/soccerdata/_common.py", line 343, in _download_and_save return io.BytesIO(response.content) File "/home/dkblu/anaconda3/envs/sportsdata/lib/python3.9/site-packages/requests/models.py", line 960, 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/
kerem closed this issue 2026-03-02 15:54:58 +03:00
Author
Owner

@probberechts commented on GitHub (Jul 18, 2022):

This is probably related to #59.
Make sure you use v1.0.2. You can check your version with:

import soccerdata as sd
sd.__version__
<!-- gh-comment-id:1187708635 --> @probberechts commented on GitHub (Jul 18, 2022): This is probably related to #59. Make sure you use v1.0.2. You can check your version with: ```py import soccerdata as sd sd.__version__ ```
Author
Owner

@clumsycompiler commented on GitHub (Jul 19, 2022):

upgraded the version, works fine. Thank you

<!-- gh-comment-id:1188939499 --> @clumsycompiler commented on GitHub (Jul 19, 2022): upgraded the version, works fine. Thank you
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#8
No description provided.