java - How to setup clj-webdriver 0.7.2 with phantomjs -
i keep trying set phantomjs create web scraper, can't driver work. have added lein dependencies so:
[org.seleniumhq.selenium/selenium-server "2.47.1"] [com.codeborne/phantomjsdriver "1.2.1" :exclusions [org.seleniumhq.selenium/selenium-java org.seleniumhq.selenium/selenium-server org.seleniumhq.selenium/selenium-remote-driver]]
then in script:
(ns vendors-api.routes.scrapers.resource (:require [clj-webdriver.core :refer [new-webdriver]]) (:import (org.openqa.selenium.phantomjs phantomjsdriver) (org.openqa.selenium.remote desiredcapabilities))) (def driver (new-webdriver {:browser (phantomjsdriver. (desiredcapabilities. ))}))
i keep getting following error:
compilerexception java.lang.reflect.invocationtargetexception, compiling
what missing?
i expect dependencies incorrect/incomplete.
the following dependency list worked me:
[clj-webdriver "0.7.2"] [org.seleniumhq.selenium/selenium-java "2.51.0"] [com.codeborne/phantomjsdriver "1.2.1" :exclusions [org.seleniumhq.selenium/selenium-java]]
and then
(require ' [clj-webdriver.core :as driver]) (def my-driver (driver/new-driver {:browser :phantomjs}))