/clj-headless

chrome remote debugging protocol implementation

Primary LanguageClojure

chrome remote debugging library https://travis-ci.org/niklasfasching/headless.svg?branch=master

A minimal (< 500 LOC 1000 LOC) chrome remote debugging protocol implementation in clojure.

(require '[headless.core :as headless])
;; chrome started with e.g. "chromium-browser --remote-debugging-port=9222"
(let [connection (headless/connect :host "localhost" :port 9222)]
  (headless/visit connection "http://example.com/")
  (->> (headless/select-one connection "h1")
       (headless/text connection))) ;; => "Example Domain"

Only 2 dependencies: clojure/data.json & yawc.

Related / Inspiration