selenium webdriver – undetected chrome driver- mismatch between chromedriver and chrome version

im running the following code using undetected_chromedriver:

import undetected_chromedriver as uc

driver = uc.Chrome()

im getting the following error:

selenium.common.exceptions.SessionNotCreatedException: Message:
session not created: cannot connect to chrome at 127.0.0.1:42071 from
session not created: This version of ChromeDriver only supports Chrome
version 131 Current browser version is 130.0.6723.116

My google chrome version is (Google Chrome 131.0.6778.69)

My chrome driver version is (ChromeDriver 131.0.6778.69)

Despite the fact that both Chrome and ChromeDriver versions match, I am still encountering a version mismatch error.

Additionally, when executing the script, there is a 50% chance that the code will run successfully without triggering the above error.

Any ideas?

Read more here: Source link