Wechaty: ChromeDriver PATH problem

Created on 18 Sep 2016  ·  3Comments  ·  Source: wechaty/wechaty

running the sample code from README.me section 'Install from Github' on a mac laptop, some error logs appear

Please wait... I'm trying to login in...

INFO Wechaty v0.3.17 initializing...
ERR PuppetWebBrowser init() exception: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
ERR PuppetWeb initBrowser() exception: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.

this link will fix the problem
http://stackoverflow.com/questions/27733731/passing-requirechromedriver-path-directly-to-selenium-webdriver

question

Most helpful comment

Thanks for your issue and solution.

This problem will bite you when you run sample code without the PATH include chromedriver.

I prefer two solution:

  1. npm install -g chromedriver to install chromedriver globaly
  2. use npm run to start your code. Because after npm install, chromedriver be installed at node_modules/.bin/chromedriver, and this path will be include in PATH if you use npm run command.

you can have a look of npm run demo in package.json here:
https://github.com/wechaty/wechaty/blob/add0b3a68bda3a1bef120c6fced7ebef30a4cb9e/package.json#L31

I'll tag this issue as FAQ because even me sometimes can't find chromedriver... ;-]

All 3 comments

Thanks for your issue and solution.

This problem will bite you when you run sample code without the PATH include chromedriver.

I prefer two solution:

  1. npm install -g chromedriver to install chromedriver globaly
  2. use npm run to start your code. Because after npm install, chromedriver be installed at node_modules/.bin/chromedriver, and this path will be include in PATH if you use npm run command.

you can have a look of npm run demo in package.json here:
https://github.com/wechaty/wechaty/blob/add0b3a68bda3a1bef120c6fced7ebef30a4cb9e/package.json#L31

I'll tag this issue as FAQ because even me sometimes can't find chromedriver... ;-]

npm run works great, but a chrome browser shows up when I run the code, is there a way to hide the chrome browser like the old phantomjs way? Thanks.

chrome browser can be hide if:

  1. use Xvfb under linux and set DISPLAY to it
  2. use cygwin under win32 and ssh to it via 127.0.0.1. in my win7, it seems more like a bug than a feature, because all windows will not appear. :p
  3. use docker to run wechaty docker. it will be more complicated than others now, because you need to build docker your self. But it will be the easiest way to run wechaty, after wechaty.io online, which is the cloud controller for wechaty docker, so you can just start wechaty standard docker as well.
  4. last but not least, we should fix phantomjs for wechaty in the future, I believe there's a compatible bug inside wx javascript, it should be easy to fix if we find out why.
Was this page helpful?
0 / 5 - 0 ratings