pythonpython-3.xselenium-webdriverselenium-chromedriverundetected-chromedriver

Which version of Chrome Driver should I download for selenium?


Now, I am using Chrome browser Version 119.0.6045.160. But the latest Chrome Driver version, I downloaded is "ChromeDriver 114.0.5735.90"

For this code in python,

from selenium import webdriver

import os

os.environ['PATH'] += r"D:/chromedriver_win32"

driver = webdriver.Chrome()

I got this error

How, to fix this error?


Solution

  • For the selenium version >4.11.0

    from selenium import webdriver
    driver = webdriver.Chrome()
    driver.get("https://www.bing.com/")
    

    Or

    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    
    service = Service()
    options = webdriver.ChromeOptions()
    driver = webdriver.Chrome(service=service, options=options)
    

    https://www.selenium.dev/documentation/selenium_manager/ https://www.selenium.dev/blog/2022/introducing-selenium-manager/ https://www.selenium.dev/blog/2023/status_of_selenium_manager_in_october_2023/