Search code examples
pythonselenium-webdriverselenium-chromedriverseleniummanager

Using Python Selenium 4.13, still getting "your version of chrome not supported message"


I just updated and verified that I am using Selenium 4.13. It's my understanding that Selenium Manager was being used with everything after Selenium 4.10 so I wouldn't have to worry about downloading the latest chromedriver every time a new Chrome version came out. I'm still in the learning stages with python so apparently I'm just not understanding something correctly.

Below is a screenshot of what I'm seeing. I'm importing selenium webdriver and the first thing i do is assign it to a variable, but it's coming back and telling me that my current browser version isn't being supported. What am I not understanding? Any help would be very much appreciated.

enter image description here


Solution

  • That could happen if the built-in selenium manager doesn't have permission to delete the existing chromedriver so that it can download a newer one to that same location. You can use the following to ignore the mismatched versioning:

    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    
    service = Service(service_args=["--disable-build-check"])
    options = webdriver.ChromeOptions()
    driver = webdriver.Chrome(service=service, options=options)
    driver.get("https://www.selenium.dev/")
    driver.quit()
    

    At which point it should work, but you may start seeing a warning message such as:

    The chromedriver version (110.0.5481.77) detected in PATH at /usr/local/bin/chromedriver might not be compatible with the detected chrome version (117.0.5938.92); currently, chromedriver 117.0.5938.92 is recommended for chrome 117.*, so it is advised to delete the driver in PATH and retry

    At which point you know exactly what to delete so that selenium manager downloads the newer version next time you run your script.