Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Watir unable to find Mozilla geckodriver

I am using Watir to crawl something, but it throw

Unable to find Mozilla geckodriver. Please download the server from https://github.com/mozilla/geckodriver/releases and place it

I've done following step.

Downloading the latest firefox (version50.0)

I download the latest version of geckodriver from https://github.com/mozilla/geckodriver/releases, and put it in ~/geckodriver

Then add export PATH=$PATH:~/geckodriver into ~/.bash_profile and source it.

Here is code I executed

require 'watir-webdriver'
browser = Watir::Browser.new :firefox # should open a new Firefox window
browser.goto 'http://nitrowriters.com/form/form.html' # or type the local path to your downloaded copy

Gemfile

source "https://rubygems.org"
gem  'nokogiri'
gem  'watir-webdriver'
gem  'open_uri_redirections'
gem  'selenium-webdriver'
gem  "watir", ">= 6.0.0.beta2"

Environment: OSX 10.10

like image 795
Coda Chang Avatar asked Nov 18 '16 05:11

Coda Chang


People also ask

Where is the Geckodriver path?

Click on the Environment Variables button. From System Variables select PATH. Click on the Edit button. Paste the path of the GeckoDriver file.


1 Answers

I had the same problem on Linux Mint 17.2. I solved it by moving the geckodriver file from the extracted tar to usr/bin (you have to have root permission to do that).

For some reason zsh would not find it if I defined it in my path variable. Maybe someone else has a better solution, but for now this works.

like image 191
DenisPanda Avatar answered Sep 19 '22 08:09

DenisPanda