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
526 stars 89 forks source link

[WhoScored] Enable setting ChomeDriver version manually #156

Open JeremieSiller opened 1 year ago

JeremieSiller commented 1 year ago

I have just tried using the library on an older machine and Chrome was a bit outdated, which caused the library to raise:

     The ChromeDriver was unable to initiate/spawn a new                                                                                                                                                                                                          
     WebBrowser. You will not be able to scrape new data.                                                                                                                                                                                                         
     Message: unknown error: cannot connect to chrome at 127.0.0.1:57261                                                                                                                                                                                          
     from session not created: This version of ChromeDriver only supports Chrome version 109                                                                                                                                                                                      
     Current browser version is 108.0.5359.124

This can easily be fixed, by allowing to add version_main to the undetected_chromedriver.ChromeDriver. For me I had to change the line 412 in _common.py to:

return uc.Chrome(options=chrome_options, version_main=108) # 108, because that's the main version of the installed chrome browser

But it would be great to have the user set this when initializing the WhoScored object or any other object that needs a Chrome-driver (but I think this is only relevant for WhoScored?)

pytoni commented 10 months ago

I got the same issue. My Chrome version is 116. I did change _common.py to return uc.Chrome(options=chrome_options, version_main=116), but it's not working.