Liking cljdoc? Tell your friends :D

Clojure Soup

Clojurized access for Jsoup.

clojars version


Get some links of a web page:

(use 'jsoup.soup)

($ (get! "" :user-agent "CoCo/1.0") ;; get request with options
   td "a[href]" ;; Jsoup selectors
   (attr "abs:href")) ;; attribute selector

Get all Emoji names concatenated by single bars from '':

($ (get! "") 
   "li div:has(span.emoji)" (text) 
   (map #(clojure.string/replace % ":" "")) 
   (clojure.string/join "|")) 

Post with basic authentication:

($ (post! ""  
        :user-agent "CoCo/1.0" 
        :follow-redirects true
        :auth (basic-auth "night" "password")
        :cookies {:user "night" :other "value"}
        :data {:param "one" :another "2"}) ;; post options & data
 td a) ;; Jsoup selectors

Parse a local file:

($ (slurp! "test-content.html" :encoding "UTF-8" :base-uri "http://base") "a[href]")

Build Status


Can you improve this documentation? These fine people already did:
Marc Fornós & mfornos
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close