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.
- https://github.com/tatut/clj-chrome-devtools/ (didn’t use this because i didn’t want all those dependencies. also not a whole lot of documentation on architecture choices.)
- https://github.com/cavalle/chrome_remote
- https://github.com/GoogleChrome/puppeteer