Skip to content

Instantly share code, notes, and snippets.

@zentrope
Last active July 29, 2020 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zentrope/4d2de1c441c7a1532a03edfbe16f4d52 to your computer and use it in GitHub Desktop.
Save zentrope/4d2de1c441c7a1532a03edfbe16f4d52 to your computer and use it in GitHub Desktop.
(def (do-post)
(http-post "http://localhost:9515/session"
headers: '(("Content-Type" . "application/json; charset=utf-8")
("Accept-Encoding" . "identity")
("Accept" . "*/*"))
data: (json-object->string capabilities)))
(def (get-session)
(let (req (do-post))
(for-each (lambda (h) (printf "~s~%" h)) (request-headers req))
(displayln (request-text req))))
(def chrome-driver-url
"http://localhost:9515/session/")
(def args
(hash (args '("--headless" "--disable-gpu"))))
(def chrome
(hash (browserName "chrome")
(goog:chromeOptions args)))
(def capabilities
(hash (capabilities (hash (firstMatch `(, chrome))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment