WebDriverException: Message: chrome not reachable after long time

后端 未结 1 876
清酒与你
清酒与你 2021-01-23 18:50

This is the code:

driver = webdriver.Chrome()
while True:
   #do thing that require hours
   #then i use selenium once
driver.get(link)

I need

相关标签:
1条回答
  • 2021-01-23 19:27

    Initially I had asked myself the same questions as @GregBurghardt had been asking in the comments till I analyzed the detailed error stack trace.

    Yes, there is somehting amazing happening in those steps marked as #do thing that require hours. Hence, instaed of showing Chrome browser version as chrome=76.0, chrome=75.0 or chrome=74.0 it shows:

    (Session info: chrome=192.168.0.0)
    

    which is pretty much surprising.

    It would be almost impossible to analyze the issue until and unless you update us why and how the Chrome version gets changed to such value.


    Having said that, possibly your main issue is the incompatibility between the version of the binaries you are using.

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

    Supports Chrome v63-65

    • Presumably you are using the latest chrome= 76.0
    • Release Notes of ChromeDriver v76.0 clearly mentions the following :

    Supports Chrome version 76

    • Your Selenium Client version is unknown to us.

    So there is a clear mismatch between the ChromeDriver v2.36 and the Chrome Browser v76.0


    Solution

    Ensure that:

    • Selenium is upgraded to current levels Version 3.141.59.
    • ChromeDriver is updated to current ChromeDriver v76.0 level.
    • Chrome is updated to current Chrome Version 76.0 level. (as per ChromeDriver v76.0 release notes)
    • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
    • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
    • Take a System Reboot.
    • Execute your @Test as non-root user.
    • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

    References:

    • Python selenium WebDriverException: chrome not reachable while opening ChromeDriver
    • selenium.common.exceptions.WebDriverException: Message: chrome not reachable error while using find_element_by_id Selenium with ChromeDriver
    • org.openqa.selenium.WebDriverException: chrome not reachable - when attempting to start a new session
    0 讨论(0)
提交回复
热议问题