Skip to content

mfornos/clojure-soup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Clojurized access for Jsoup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published