dom-selector: DOM traversal by CSS selectors for xml-conduit package

[ bsd3, library, web ] [ Propose Tags ]

CSS selector support for xml-conduit/html-conduit. This package supports compile-time checking of CSS selectors using quasiquotes.

-- The following pragmas should be put first (Haddock does not accept a pragma notation.)
-- LANGUAGE OverloadedStrings, QuasiQuotes
module Main (main) where

import Text.XML.Cursor
import qualified Text.HTML.DOM as H (readFile)
import qualified Data.Text.Lazy.IO as TI (putStrLn)
import Text.XML.Scraping (innerHtml)
import Text.XML.Selector.TH

main :: IO ()
main = do
  c <- fmap fromDocument $ H.readFile "input.html"
  let cs = queryT [jq| ul#foo > li.bar |] c
  TI.putStrLn $ innerHtml cs

You can use some elementary CSS selectors for traversing a DOM tree.

https://github.com/nebuta/dom-selector/tree/master/examples

Versions [faq] 0.1.0.0, 0.2.0.0, 0.2.0.1
Dependencies base (>=4.0 && <5), blaze-html (>=0.5), containers (>=0.4), html-conduit (>=0.1), parsec (>=3.1), QuickCheck (>=2.4), template-haskell (>=2.5), text (==0.11.*), th-lift (>=0.5), xml-conduit [details]
License BSD-3-Clause
Copyright Copyright 2012 by Nebuta Lab
Author Nebuta Lab
Maintainer nebuta.office@gmail.com
Category Web
Home page https://github.com/nebuta/
Source repo head: git clone https://github.com/nebuta/dom-selector
Uploaded by nebuta at Tue Aug 14 23:39:29 UTC 2012
Distributions NixOS:0.2.0.1
Downloads 1864 total (7 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees