Because of changes to the underlying JavaFX libraries, this library currently works with Java 1.8! It will fail immediately on more modern JVMs.
N.B. While Oracle's JVM bundles JavaFX, the OpenJDK JVM does not come with it. If you're using OpenJDK (which is the default on ubuntu, for example), you must also install the OpenJFX package on your chosen platform in order to use this library.
This example fetches the Clojure homepage, extracts some elements and retrieves the text of one:
(require '[sparkledriver.browser :refer [with-browser make-browser fetch!]]) (require '[sparkledriver.element :refer [find-by-xpath* text]]) (with-browser [browser (make-browser)] (-> (fetch! browser "http://clojure.org") (find-by-xpath* "//div[@class='clj-intro-message']/p") (nth 2) text)) ;;=> "I hope you find Clojure's combination of facilities elegant, powerful, practical and fun to use."
A Note on Dependencies
A case has
where an old version of
common-codec, as a library dependency, was
causing the tests to fail. If you experience this issue, please add
the following dependency:
to your project.
While there are still a few areas where the underlying APIs could be more completely wrapped, the core functionality has been enrobed in delicious parentheses. Some bits are better tested than others, but I am currently using this library in production.
Copyright © 2016-2019 Jack Rusher
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.