#Once the zip has finished downloading, extract the folder and copy the path of the chromedriver exe file (should be the #first one), add it to your code like this,
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
url = "somewebsite.com"
service_obj = Service("D:\\Users\\eggman\Downloads\chromedriver-win64\chromedriver-win64\chromedriver.exe")
driver = webdriver.Chrome(service=service_obj)
driver.get(url)
Returns the error:
selenium.common.exceptions.SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 114. LATEST_RELEASE_115 doesn't exist
I'm guessing to avoid this in the future I can just turn off automatic updates?
I originally used the following code which worked fine
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
For Chrome/chromedriver 116+, the solution is similar to https://stackoverflow.com/a/76731553/7058266, but now you need a minimum selenium
version of 4.11.2
. Then selenium
gets the correct driver for you at runtime.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
# ... Automate something here
driver.quit()
For more info on the new Chrome-for-Testing, see https://googlechromelabs.github.io/chrome-for-testing/ (this also includes chromedrivers for testing).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With