Clojurized access for Jsoup.
Clojure
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/jsoup
test
.gitattributes
.gitignore
.travis.yml
README.md
project.clj

README.md

Clojure Soup

Clojurized access for Jsoup.

clojars version

Examples

Get some links of a web page:

(use 'jsoup.soup)

($ (get! "http://google.com" :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 'emoji-cheat-sheet.com':

($ (get! "http://www.emoji-cheat-sheet.com/") 
   "li div:has(span.emoji)" (text) 
   (map #(clojure.string/replace % ":" "")) 
   (clojure.string/join "|")) 

Post with basic authentication:

($ (post! "http://127.0.0.1"  
        :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

EOF