Caleb Beers
Caleb Beers

Reputation: 76

Webdriver stopped opening Firefox

So, I'm using etaoin to do some webdriver stuff in Clojure. It was working fine for a while. However, my program is crashing on line 7 of this:

(ns socialauto.core) (require '[etaoin.api :as e]) (require '[etaoin.keys :as k])

(require '[socialauto.scraper :as scraper])

(def driver (e/firefox))

When it goes to define the firefox driver (def driver (e/firefox)), it just blows up. It gives me this error:

#error { :cause throw+: {:response {:value {:error "unknown error", :message "Process unexpectedly closed with status signal", :stacktrace ""}}, :path "session", :payload {:desiredCapabilities {:loggingPrefs {:browser "ALL"}}}, :method :post, :type :etaoin/http-error, :port 64044, :host "127.0.0.1", :status 500, :webdriver-url nil, :driver {:type :firefox, :host "127.0.0.1", :port 64044, :url "http://127.0.0.1:64044", :locator "xpath", :capabilities {:loggingPrefs {:browser "ALL"}}, :args ("geckodriver" "--port" 64044), :process {:proc #object[java.lang.ProcessImpl 0x321bf4b1 "Process[pid=9879, exitValue="not exited"]"], :exit nil, :in #object[java.lang.ProcessImpl$ProcessPipeOutputStream 0x598f6c93 "java.lang.ProcessImpl$ProcessPipeOutputStream@598f6c93"], :out #object[java.lang.ProcessBuilder$NullInputStream 0x65630116 "java.lang.ProcessBuilder$NullInputStream@65630116"], :err #object[java.lang.ProcessBuilder$NullInputStream 0x65630116 "java.lang.ProcessBuilder$NullInputStream@65630116"], :prev nil, :cmd ["geckodriver" "--port" "64044"]}}}

This began happening one morning when I went to run the program. It had been running fine the day before.

I have uninstalled and reinstalled both Geckodriver and Firefox. That did not fix it. I was expecting it to be some kind of versioning problem, and thought maybe that Firefox had updated without my knowledge.

Upvotes: 1

Views: 111

Answers (1)

Caleb Beers
Caleb Beers

Reputation: 76

So, I figured out what the problem was, for anyone else who has this issue.

I had to change

(def driver (e/firefox))

to

(def driver (e/firefox {:path-driver "/opt/homebrew/bin/geckodriver" :path-browser "/opt/homebrew/bin/firefox"}))

I guess this issue came from etaoin not finding either the browser or the driver, so I get the paths for both.

For anyone else who has this issue: run where geckodriver and where firefox and set the outputs of those as values to the keys :path-driver and :path-browser.

Upvotes: 2

Related Questions