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

Add FIFA Women's World Cup whoscored data #299

Closed clairesecehDS closed 11 months ago

clairesecehDS commented 11 months ago

Is it possible to add FIFA Women's World Cup to validated scraping league?

probberechts commented 11 months ago

I have not fully tested it yet, but it seems straightforward to add support for scraping the FIFA Women's World Cup data from FBref and WhoScored. I'll add it to the default supported leagues and make sure everything works tomorrow or during the weekend. If you would like to use it already, you should add the following to the SOCCERDATA_DIR/config/league_dict.json file:

"INT-Women's World Cup": {
    "FBref": "FIFA Women's World Cup",
    "WhoScored": "International - FIFA Women's World Cup",
}

Next, you should be able to scrape the data with:

import soccerdata as sd

ws = sd.WhoScored("INT-Women's World Cup", 2324, no_cache=True)
df_events = ws.read_events(match_id=1751717)

fbref = sd.FBref("INT-Women's World Cup", 2324, no_cache=True)
df_team_season_stats = fbref.read_team_season_stats()
clairesecehDS commented 11 months ago

That's worked fine. Thanks for your time!