[GH-ISSUE #861] [WhoScored] Chrome v140 / ChromeDriver v138 mismatch & 502 errors with undetected_chromedriver #183

Closed
opened 2026-03-02 15:56:27 +03:00 by kerem · 1 comment
Owner

Originally created by @ds-oliver on GitHub (Jul 21, 2025).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/861

Describe the bug

undetected_chromedriver cannot create a Selenium session for WhoScored because the auto-downloaded ChromeDriver does not match the locally installed Chrome (browser v140, driver v138).
When the driver manages to start (after pinning UC 3.5.4), WhoScored often returns a 502 Bad Gateway or empty JSON, causing "NoneType" object is not iterable" in read_schedule().

Expected behavior
ws.read_schedule() (and other calls) should launch a compatible Chrome + driver pair, fetch the HTML/JSON, and return a populated DataFrame without manual driver hacks.


Affected scrapers

WhoScored


Code example

import os, ssl, certifi, soccerdata as sd

#––– optional: force a specific driver version (tried 138, 140, 125)
os.environ["UC_BROWSER_VERSION"] = "138"

SSL workaround we tried (doesn’t impact the bug):

ssl._create_default_https_context = lambda: ssl.create_default_context(
cafile=certifi.where()
)

ws = sd.WhoScored(
leagues=["ENG-Premier League"],
seasons=["2425"], # WhoScored season format
no_cache=True, # ensure fresh request
headless=False
)
ws.read_schedule()


Error message

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 138
Current browser version is 140.0.7309.0 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

OR (when driver starts):

Failed to fetch schedule for ENG-Premier League season 2425: 'NoneType' object is not iterable

Occasionally:

GET https://www.whoscored.com/…  --> 502 Bad Gateway

Additional context

What we already tried (none fully successful)

Attempt Result
Pin undetected_chromedriver==3.5.4 Opens WhoScored home page, still fails on league fetch
Set UC_BROWSER_VERSION (138 / 140 / 125) v138 removes version-mismatch error if matching driver is found, but UC re-downloads a mismatching build on next run
Homebrew google-chrome@138, chromedriver reinstall macOS cannot keep Chrome pinned; browser auto-updates back to v140
Custom headers & non-headless Bypasses some 403/502, not consistent
Proxies (Surfshark rotation, proxy="tor", custom dict) Does not affect driver mismatch; 502 frequency unchanged
selenium<4.13.0 Required by WhoScored wrapper but doesn’t impact the mismatch
Certifi SSL override No effect on driver pairing

Environment (high-level):

macOS Sonoma
Python 3.10.4
Chrome 140.0.7309.0 (cannot downgrade permanently)
undetected_chromedriver 3.5.4
selenium 4.12.0
soccerdata 1.8.7

Contributor Action Plan

I’m not able to fix this issue.


Happy to provide full pip freeze, stack traces, or test URLs if that helps debug further.

</html>
Originally created by @ds-oliver on GitHub (Jul 21, 2025). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/861 <h3><strong>Describe the bug</strong></h3> <p><code inline="">undetected_chromedriver</code> cannot create a Selenium session for WhoScored because the auto-downloaded ChromeDriver does <strong>not</strong> match the locally installed Chrome (browser v140, driver v138).<br> When the driver manages to start (after pinning UC 3.5.4), WhoScored often returns a <strong>502 Bad Gateway</strong> or empty JSON, causing <code inline="">"NoneType" object is not iterable"</code> in <code inline="">read_schedule()</code>.</p> <p><strong>Expected behavior</strong><br> <code inline="">ws.read_schedule()</code> (and other calls) should launch a compatible Chrome + driver pair, fetch the HTML/JSON, and return a populated DataFrame without manual driver hacks.</p> <hr> <h3><strong>Affected scrapers</strong></h3> <p><input type="checkbox" checked="" disabled=""> <strong>WhoScored</strong></p> </li> </ul> <hr> <h3><strong>Code example</strong></h3> <pre><code class="language-python">import os, ssl, certifi, soccerdata as sd #––– optional: force a specific driver version (tried 138, 140, 125) os.environ["UC_BROWSER_VERSION"] = "138" # SSL workaround we tried (doesn’t impact the bug): ssl._create_default_https_context = lambda: ssl.create_default_context( cafile=certifi.where() ) ws = sd.WhoScored( leagues=["ENG-Premier League"], seasons=["2425"], # WhoScored season format no_cache=True, # ensure fresh request headless=False ) ws.read_schedule() </code></pre> <hr> <h3><strong>Error message</strong></h3> <pre><code>selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 138 Current browser version is 140.0.7309.0 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome </code></pre> <p>OR (when driver starts):</p> <pre><code>Failed to fetch schedule for ENG-Premier League season 2425: 'NoneType' object is not iterable </code></pre> <p>Occasionally:</p> <pre><code>GET https://www.whoscored.com/… --&gt; 502 Bad Gateway </code></pre> <hr> <h3><strong>Additional context</strong></h3> <p><em>What we already tried (none fully successful)</em></p> Attempt | Result -- | -- Pin undetected_chromedriver==3.5.4 | Opens WhoScored home page, still fails on league fetch Set UC_BROWSER_VERSION (138 / 140 / 125) | v138 removes version-mismatch error if matching driver is found, but UC re-downloads a mismatching build on next run Homebrew google-chrome@138, chromedriver reinstall | macOS cannot keep Chrome pinned; browser auto-updates back to v140 Custom headers & non-headless | Bypasses some 403/502, not consistent Proxies (Surfshark rotation, proxy="tor", custom dict) | Does not affect driver mismatch; 502 frequency unchanged selenium<4.13.0 | Required by WhoScored wrapper but doesn’t impact the mismatch Certifi SSL override | No effect on driver pairing <p>Environment (high-level):</p> <pre><code>macOS Sonoma Python 3.10.4 Chrome 140.0.7309.0 (cannot downgrade permanently) undetected_chromedriver 3.5.4 selenium 4.12.0 soccerdata 1.8.7 </code></pre> <hr> <h3><strong>Contributor Action Plan</strong></h3> <p><input type="checkbox" disabled=""> I’m not able to fix this issue.</p> </li> </ul> <hr> <p><em>Happy to provide full <code inline="">pip freeze</code>, stack traces, or test URLs if that helps debug further.</em></p></body></html>
kerem 2026-03-02 15:56:27 +03:00
Author
Owner

@probberechts commented on GitHub (Aug 23, 2025):

Closing since we are no longer using undetected chromedriver.

<!-- gh-comment-id:3217376218 --> @probberechts commented on GitHub (Aug 23, 2025): Closing since we are no longer using undetected chromedriver.
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#183
No description provided.