probberechts / soccerdata

⛏⚽ Scrape soccer data from Club Elo, ESPN, FBref, FiveThirtyEight, Football-Data.co.uk, FotMob, Sofascore, SoFIFA, Understat and WhoScored.
https://soccerdata.readthedocs.io/en/latest/
Other
529 stars 90 forks source link

[FBref] Error while scraping Spain comps using read_team_match_stats #466

Closed Szymok closed 5 months ago

Szymok commented 5 months ago

Hello everyone,

I want to use a read_team_match_stats() to scrape team match stats, but the scraping is ending with error: Internal Server Error for url:
https://fbref.com/en/squads/8d6fd021/matchlogs/all_comps/shooting.

image

Correct url: https://fbref.com/en/squads/8d6fd021/2023-2024/matchlogs/all_comps/shooting

So i think there is a problem with adding a seasong during building an url.

probberechts commented 5 months ago

This seems to work fine for me. It looks like this was fixed in #384. Are you sure you have the latest version?

import soccerdata as sd
fbref = sd.FBref("ESP-La Liga", 2324, no_cache=True)
fbref.read_team_match_stats('shooting')
Szymok commented 5 months ago

Yes you're right, my fault, sorry