### Installing Reaver Dependency in Clojure Source: https://github.com/mischov/reaver/blob/master/README.md This snippet shows how to add Reaver as a project dependency in a Clojure application. The provided line should be added to the `project.clj` file under the `:dependencies` vector, allowing the project to use Reaver's functionalities. ```Clojure [reaver "0.1.3"] ``` -------------------------------- ### Extracting Headlines and Links from HTML using Reaver Source: https://github.com/mischov/reaver/blob/master/README.md This snippet demonstrates how to use Reaver to parse an HTML string and extract specific data, such as headlines and URLs, into a sequence of Clojure maps. It requires an HTML string as input, which can be fetched using `slurp` or other HTTP clients. The `parse` function converts the HTML into a traversable structure, and `extract-from` uses CSS selectors to pull out desired elements and their attributes or text content. ```Clojure (require '[reaver :refer [parse extract-from text attr]]) ; Reaver doesn't tell you how fetch your HTML. Use `slurp` or ; aleph or clj-http or what-have-you. (def hacker-news (slurp "https://news.ycombinator.com/")) ; Extract the headlines and urls from the HTML into a seq of maps. (extract-from (parse hacker-news) ".itemlist .athing" [:headline :url] ".title > a" text ".title > a" (attr :href)) ;> ({:headline "...", :url "..."}, {:headline "...", :url "..."}, ...) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.