(attr attribute)
(attr x attribute)
Convenience function allowing:
(chain (attr :href) ..)
instead of requiring:
(chain #(attr* % :href) ..)
Convenience function allowing: (chain (attr :href) ..) instead of requiring: (chain #(attr* % :href) ..)
(chain & fns)
Executes the supplied functions in left to right order on an element.
(chain text parse-date)
Executes the supplied functions in left to right order on an element. (chain text parse-date)
(to-edn jsoup)
Converts Jsoup into an edn representation of HTML.
{:type Keyword :tag Keyword|nil :attrs {Keyword String, ...}|nil :content Vector|Map|String|nil}
Converts Jsoup into an edn representation of HTML. {:type Keyword :tag Keyword|nil :attrs {Keyword String, ...}|nil :content Vector|Map|String|nil}
(extract source ks & extractions)
ks is a vector of keys that will be zipped into a map with the extracted data, ie:
{(first ks) (first (run-extractions source extractions))}
If ks is nil or empty, a sequence of extracted data will be returned instead.
Extractions are a selector (see select
) followed by an
extractor (see Extractable
).
(extract (parse subreddit) [:headlines] ".sitetable .thing .title a.title" text)
ks is a vector of keys that will be zipped into a map with the extracted data, ie: {(first ks) (first (run-extractions source extractions))} If ks is nil or empty, a sequence of extracted data will be returned instead. Extractions are a selector (see `select`) followed by an extractor (see `Extractable`). (extract (parse subreddit) [:headlines] ".sitetable .thing .title a.title" text)
(extract-from source selector ks & extractions)
Behaves like extract, but prior to running extractions uses the provided selector to narrow down the data to be searched.
This is useful, for instance, when one wants to select a sequence of items, then extract identical information from each.
Behaves like extract, but prior to running extractions uses the provided selector to narrow down the data to be searched. This is useful, for instance, when one wants to select a sequence of items, then extract identical information from each.
(attr* x a)
Returns a string representing the node's value for the supplied attribute (or nil, if it has no value)
Returns a string representing the node's value for the supplied attribute (or nil, if it has no value)
(attrs x)
Returns a map of keyword/string pairs representing the node's attributes.
Returns a map of keyword/string pairs representing the node's attributes.
(data x)
Returns a string representing all the data (ie. from scripts) contained by the node.
Returns a string representing all the data (ie. from scripts) contained by the node.
(edn x)
Returns data in edn format.
Returns data in edn format.
(jsoup x)
Returns data in Jsoup types.
Returns data in Jsoup types.
(tag x)
Returns a keyword representing the node's html tag (if it has one)
Returns a keyword representing the node's html tag (if it has one)
(text x)
Returns a string representing all the text contained by the node.
Returns a string representing all the text contained by the node.
(parse html)
Parses a string representing a full HTML document into Jsoup.
Parses a string representing a full HTML document into Jsoup.
(parse-fragment html)
Parses a string representing a fragment of HTML into Jsoup.
Parses a string representing a fragment of HTML into Jsoup.
(reduce-into empty-coll xs)
Imperfectly mimics 'into' with 'reduce' and 'conj' for better performance.
Imperfectly mimics 'into' with 'reduce' and 'conj' for better performance.
(select node css-selector)
Given HTML parsed to Jsoup and a string representing a CSS-esque selector, select* returns Jsoup representing any successfully selected data.
For more on selector syntax, see: http://jsoup.org/cookbook/extracting-data/selector-syntax
Given HTML parsed to Jsoup and a string representing a CSS-esque selector, select* returns Jsoup representing any successfully selected data. For more on selector syntax, see: http://jsoup.org/cookbook/extracting-data/selector-syntax
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close