Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Nokogiri for Clojure
Clojure
tree: e03279e4d7

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/yokogiri
test/yokogiri/test
.gitignore
.travis.yml
CHANGELOG.org
README.markdown
project.clj

README.markdown

yokogiri

status

Build Status

getting started

In your project.clj: [yokogiri "1.5.4"]

  (ns myproject.core
    (:require [yokogiri.core :as yokogiri]))

or

  (ns myproject.core
    (:use [yokogiri.core]))

usage

  (def client (make-client))

  ;; with javascript enabled (see source for additional options):
  (def client (make-client :javascript true))

  (def page (get-page client "http://example.com"))

  ;; xpath
  (def anchor-node-text (map node-text (xpath page "//a")))

  ;; css
  (def footer-feedback-text
    (map node-text (css page "div.footer-beta-feedback")))

  ;; get specific attributes
  (def a-attr-href
    (map #(select-keys (attr-map %) [:href])
      (-> page css "div.link a")))

license

Copyright (C) 2013 Devin Walters

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.