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?
Found solution by adding path of chrome to the chrome options. (using options.binary_location)
import undetected_chromedriver as uc
options = webdriver.ChromeOptions()
options.binary_location = "/usr/bin/google-chrome"
driver = uc.Chrome(options=options)
For above to work, chrome and chromedriver have to have matching versions.