(require '[shelob.core :as sh])
(require '[shelob.browser :as shb])
(require '[shelob.scraper :as shs])
(def context
{:driver-options {:browser :firefox}
:pool-size 2
:init-messages [{:msg :go :url "https://duckduckgo.com/"}]}))
(defn scrape-result
[document]
(map shs/text (shs/select document ".result__url__domain")))
(defn example
[]
(sh/init context)
(let [msg [{:msg :fill
:locator (shb/by-css-selector "#search_form_input_homepage")
:text "Clojure"}
{:msg :click :locator (shb/by-css-selector "#search_button_homepage")}]]
(sh/send-message context scrape-result msg))
(sh/stop))