[BUG] This version of ChromeDriver only supports Chrome version
jungx098 opened this issue · 5 comments
Before submitting a bug report...
- This bug wasn't already reported.
(I have checked every bug report on GitHub)
Title
- The title is no longer "[BUG] Title" and I edited it with the right error name.
Describe the bug
undetected_chromedriver automatically downloads the latest ChromeDriver, which can cause a version mismatch with the system Chrome. Updating Chrome can resolve this issue, but may require manual intervention.
Can we update the system Chrome automatically? If not, this error can be avoided programmatically by checking the current system Chrome version and setting the ChromeDriver version accordingly.
Copy and paste your error
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: cannot connect to chrome at 127.0.0.1:59053
from session not created: This version of ChromeDriver only supports Chrome version 126
Current browser version is 125.0.6422.142
Stacktrace:
0 undetected_chromedriver 0x0000000102fe80f8 undetected_chromedriver + 5169400
1 undetected_chromedriver 0x0000000102fdffca undetected_chromedriver + 5136330
2 undetected_chromedriver 0x0000000102b5c36c undetected_chromedriver + 402284
3 undetected_chromedriver 0x0000000102b99113 undetected_chromedriver + 651539
4 undetected_chromedriver 0x0000000102b98230 undetected_chromedriver + 647728
5 undetected_chromedriver 0x0000000102b8e1ae undetected_chromedriver + 606638
6 undetected_chromedriver 0x0000000102bd982d undetected_chromedriver + 915501
7 undetected_chromedriver 0x0000000102bcc853 undetected_chromedriver + 862291
8 undetected_chromedriver 0x0000000102b9c5c6 undetected_chromedriver + 665030
9 undetected_chromedriver 0x0000000102b9ce4e undetected_chromedriver + 667214
10 undetected_chromedriver 0x0000000102faad10 undetected_chromedriver + 4918544
11 undetected_chromedriver 0x0000000102fafd0d undetected_chromedriver + 4939021
12 undetected_chromedriver 0x0000000102fb03e5 undetected_chromedriver + 4940773
13 undetected_chromedriver 0x0000000102f8bdf4 undetected_chromedriver + 4791796
14 undetected_chromedriver 0x0000000102fb06d9 undetected_chromedriver + 4941529
15 undetected_chromedriver 0x0000000102f7d5c4 undetected_chromedriver + 4732356
16 undetected_chromedriver 0x0000000102fd08a8 undetected_chromedriver + 5073064
17 undetected_chromedriver 0x0000000102fd0a67 undetected_chromedriver + 5073511
18 undetected_chromedriver 0x0000000102fdfb7e undetected_chromedriver + 5135230
19 libsystem_pthread.dylib 0x00007ff80771e18b _pthread_start + 99
20 libsystem_pthread.dylib 0x00007ff807719ae3 thread_start + 15
Screenshots
NA
Value of dashboard variable
NA
Try open google chrome normally, update it. Then run the script again.
@agustinscaz Yes, that's what I'm doing, but I'm looking for an automated solution to avoid having to go through this manual process.
On ubuntu I am using that method:
def update_chrome():
try:
subprocess.run(['sudo', 'apt-get', 'update'], check=True)
subprocess.run(['sudo', 'apt-get', 'install', '--only-upgrade', 'google-chrome-stable'], check=True)
print("Google Chrome has been updated.")
except subprocess.CalledProcessError as e:
print(f"An error occured: {e}")
Would be nice to have this, arguably more enhancement than bug