WebDriverException: Message: chrome not reachable

∥☆過路亽.° 提交于 2019-12-23 04:17:17

问题


I use Selenium Python, when I run my crawler I got this error

WebDriverException: Message: chrome not reachable
  (Driver info: chromedriver=2.9.248304,platform=Linux 3.16.0-4-amd64 x86_64)

I read this question

I downloaded chromedriver (binary) and I copy/paste it to /usr/bin I tried by

driver = webdriver.Chrome('/usr/bin/chromedriver')

but I have the same error


回答1:


In your protractor.configuration file, if you have the following:

capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      'binary': 'path/to/chromedriver.exe';
    }   },

Then please remove that binary and instead point to the chromdriver like this:

//protractor.conf.js
chromeDriver: "C:/path/to/chromedriver.exe",
capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {

    }
  },

Notice how I removed the 'binary' argument from the capabilities and added the "chromedriver:" attribute.

That worked for me in removing that annoying error that says "

    UnknownError: chrome not reachable
        28-Jul-2016 10:16:57      
    (Driver info: chromedriver=2.19.346078 (6f1f0cde889532d48ce8242342d0b84f94b114a1),
platform=Windows NT 10.0 x86_64)
 (WARNING: The server did not provide any stacktrace information)

Lastly makes sure you update both chromedriver and seleniumServer like this:

webdriver-manager update

OR Run this command below to update to a SPECIFIC chromedriver version i.e v2.24 as of 10/04/2016:

webdriver-manager update --versions.chrome 2.24

if it says that the command is not recognized, then add it to your PATH in windows environment variable. The webdriver-manager generally sits in the Protractor folder which you can get with npm install protractor



来源:https://stackoverflow.com/questions/38439199/webdriverexception-message-chrome-not-reachable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!