selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 70 and 73 with ChromeDriver

前端 未结 11 1433
轮回少年
轮回少年 2021-02-05 08:03

I am trying to create a webcrawler using Selenium, but I get this error when I try to create the webdriver object.

selenium.common.exceptions.SessionNotCreatedEx         


        
相关标签:
11条回答
  • 2021-02-05 08:57

    This error message...

    selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 70 and 73
    (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 6.1.7601 SP1 x86_64)
    

    ...implies that Chrome version must be between 70 and 73


    Your main issue is the version compatibility between the binaries you are using as follows :

    • You are using chromedriver=2.45
    • Release Notes of chromedriver=2.45 clearly mentions the following :

    Supports Chrome v70-72

    • You are using chrome=68.0
    • Release Notes of ChromeDriver v2.41 clearly mentions the following :

    Supports Chrome v67-69

    So there is a clear mismatch between ChromeDriver v2.45 and the Chrome Browser v68.0


    Solution

    • Upgrade ChromeDriver to current ChromeDriver v2.45 level.
    • Keep Chrome version between Chrome v70-72 levels. (as per ChromeDriver v2.45 release notes)
    • Take a System Reboot.
    • Execute your @Test.

    Alternative

    Somehow I feel there are 2 versions of Chrome browser installed in your system. If that is the case you need to mention the absolute location of the Chrome binary within your program and you can use the following solution:

    • Code Block:

      from selenium import webdriver
      from selenium.webdriver.chrome.options import Options
      options = Options()
      options.binary_location = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
      driver = webdriver.Chrome(chrome_options=options, executable_path="C:/Utility/BrowserDrivers/chromedriver.exe", )
      driver.get('http://google.com/')
      
    • You can find a detailed discussion in Set chrome browser binary through chromedriver in Python

    Note: You can find a relevant discussion in Session not created exception: Chrome version must be >= x.y.z when using Selenium Webdriver with Chrome


    Reference

    You can find a relevant detailed discussion in:

    • How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
    0 讨论(0)
  • 2021-02-05 08:58

    For me, upgrading the driver did the trick. Just run:

    brew cask upgrade chromedriver
    

    and then try running your test again. Hope it helps!

    0 讨论(0)
  • 2021-02-05 09:00

    I encountered the same problem. I tried installing a downgraded version of Chrome (current stable was 74 and the driver required chrome version must be between 70-73) but I wasn't able to do so.

    I found another way. This link will show you which version is compatible with your current google-chrome (to know your version the command is google-chrome --version)

    This link will guide you as to how to install chrome driver with zip file. The commands are:

    cd
    wget <URL to zip file>
    unzip chromedriver_linux64.zip
    sudo mv chromedriver /usr/bin/chromedriver
    sudo chown root:root /usr/bin/chromedriver
    sudo chmod +x /usr/bin/chromedriver
    

    In case the error comes No such file or directory: '/usr/lib/chromium-browser/chromedriver' OR the same error persists

    Repeat the above procedure with the path /usr/lib/chromium-browser/chromedriver instead of /usr/bin/chromedriver

    For me, google-chrome version 74 worked with ChromeDriver version 73

    0 讨论(0)
  • 2021-02-05 09:02

    You can find the older versions of chrome driver here.

    I dont think it is a good idea to install chrome from sources other than the official channel and installation of the same can cause issues. See if the google update service is running in your PC. This will automatically update the chrome version to latest. Mine is running Version 71.0.3578.98 (Official Build) (64-bit).

    0 讨论(0)
  • 2021-02-05 09:06

    There are two options to resolve this issue:

    1. If your Chrome version is not updated -> Update it

    Steps: 1. Go to Help -> About Google Chrome -> Chrome will automatically look for updates(update Chrome to the latest version)

    2. If your chrome version is already up to date -> Then you need to upgrade you chrome driver version

    Here is the link: http://chromedriver.chromium.org/downloads

    0 讨论(0)
提交回复
热议问题