Giter VIP home page Giter VIP logo

cljsoup's Introduction

cljsoup

Clojure html/xml parser based on jsoup.

This is a small library tha wraps a well java library for parsing html into a clojure idiomatic api. Cljsoup only exposes a parser api and it does not have intentions to expose a mutanle api.

NOTE: Currently it does not support all api that jsoup support out the box. But, if you need some method that is not implemented in cljsoup, let me know or make a pull-request."

User Guide

Parse document

(require '[cljsoup.core :as cr]
         '[cljsoup.document :as dc])
(def document (cr/from-string "<head><title>Hello World</title></head>"))

Get Title

(println (dc/title document))
;; -> "Hello World"

Traversing dom

(require '[cljsoup.element :as el])
(def elm (el/first (el/select document "title")))
(println (el/outer-html elm))
;; -> "<title>Hello World</title>"

Api Documentation

Currently api documentation is not available online, but you can build it manually:

git clone https://github.com/niwibe/cljsoup
cd cljsoup
lein doc
chromium doc/index.html

License

Copyright © 2013 Andrey Antukh

Distributed under the Apache 2.0 License.

cljsoup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.