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
516 stars 88 forks source link

[WhoScored] schedule scrapper works for prem but not for any other top 5 leagues #558

Closed bradyjj closed 2 months ago

bradyjj commented 2 months ago

I was able to successfully scrap the schedules for premier league using this:

ws = sd.WhoScored(leagues='ENG-Premier League', seasons=seasons, headless=False)

try:
    # Fetch the schedule
    schedule = ws.read_schedule()
    print("Fetched schedule:", schedule)

However, when I switch leagues to 'ESP-La Liga' and run script again I get this error as my exception: Error during processing: "None of ['league', 'season'] are in the columns" I also tried using 'FRA-Ligue 1', 'GER-Bundesliga', 'ITA-Serie A'

bradyjj commented 2 months ago

Also had issue using tor as suggested where the captcha kept failing.

probberechts commented 2 months ago

This could be related to #97.

Could you try with

ws = sd.WhoScored(leagues=league, seasons=seasons, no_cache=True)

Tor indeed does no longer work with Whoscored. I'll update the docs.

bradyjj commented 2 months ago

Thank you, this worked!