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

前端 未结 11 1455
轮回少年
轮回少年 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:44

    If you end up here and you're using Laravel / Dusk, try:

    php artisan dusk:chrome-driver
    
    0 讨论(0)
  • 2021-02-05 08:47

    In Summary:

    • Find your chrome version (Help-> About Google Chrome)
    • Find your chromedriver version, if you already have one. (For me "chromedriver.exe -v" gave me the version on windows environment.)
    • Visit the official chrome webdriver page (http://chromedriver.chromium.org/downloads)
    • Download the chromedriver matching your chrome browser version, from the above download location.
    • Have a glance at the release notes on this download page towards lower section of the page, which gives an clear idea regarding which driver to use for which version of browser.
    • You can put the downloaded chromedriver binary in the path environment.

    There you go. All the best!

    0 讨论(0)
  • 2021-02-05 08:48

    Just download chromedriver extension 2.8 or 2.9 from here.

    Extract it and add this extension to /usr/local/bin

    0 讨论(0)
  • 2021-02-05 08:54

    I faced this issue due to mismatch of chromedriver and chrome version. I followed the below steps to resolve my issue:

    1) First, find out which version of Chrome you are using. My Chrome version was 77.0.3865.90.
    2) Take the Chrome version number, remove the last part, and append the result to URL "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_". For example, with Chrome version 77.0.3865.90, you'd get a URL "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_77.0.3865".
    3) Use the URL created in the last step to retrieve the version of ChromeDriver to use. For example, the above URL will get your a file containing "77.0.3865.40". (The actual number may change in the future, of course.)
    4) I then did :
      webdriverdownloader chrome:77.0.3865.40 on my mac terminal.
    

    After this your Chromedriver and Chrome version must be in sync and the issue should be fixed.

    0 讨论(0)
  • 2021-02-05 08:54

    Your chrome version is very old. Version 68 is not the latest version. For all operating systems, Chrome is currently in version 71+. Please see the list here.

    Alternatively, this is the link for downloading older versions.

    0 讨论(0)
  • 2021-02-05 08:57

    You have to match the chromedriver version number and your web browser chrome version , If both of the version match then it is best.

    > For Example - 1- your web browser chrome version is 77 ( For checking your web browser chrome version got to your web browser help and then About Google Chrome there you will find your web browser chrome version ) . 2- Now download same version here 77 chromedriver from https://chromedriver.chromium.org/downloads . 3- Make google chrome as your default web browser . All done . Your code will run fine.

    from selenium import webdriver
    
    driver=webdriver.Chrome("chromedriver.exe")
    
    # Below line of code provide
    driver.get('http://python.org')
    
    html_doc=driver.page_source
    
    print("Html code of http://python.org web page :",html_doc)
    
    0 讨论(0)
提交回复
热议问题