MIT licensed by Michael Snoyman
Maintained by [email protected]
This version can be pinned in stack with:html-conduit-1.3.2.2@sha256:14c6d87d10cd2ae77a548c71101fa09b7d86bb8cdf14646588b3dcce06ddd6a3,2177

Module documentation for 1.3.2.2

This package uses tagstream-conduit for its parser. It automatically balances mismatched tags, so that there shouldn’t be any parse failures. It does not handle a full HTML document rendering, such as adding missing html and head tags. Note that, since version 1.3.1, it uses an inlined copy of tagstream-conduit with entity decoding bugfixes applied.

Simple usage example:

#!/usr/bin/env stack
{- stack --install-ghc --resolver lts-6.23 runghc
   --package http-conduit --package html-conduit
-}
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text.IO        as T
import           Network.HTTP.Simple (httpSink)
import           Text.HTML.DOM       (sinkDoc)
import           Text.XML.Cursor     (attributeIs, content, element,
                                      fromDocument, ($//), (&/), (&//))

main :: IO ()
main = do
    doc <- httpSink "http://www.yesodweb.com/book" $ const sinkDoc
    let cursor = fromDocument doc
    T.putStrLn "Chapters in the Yesod book:\n"
    mapM_ T.putStrLn
      $ cursor
      $// attributeIs "class" "main-listing"
      &// element "li"
      &/ element "a"
      &/ content

Changes

ChangeLog for html-conduit

1.3.2.2

  • Fix handling of mixed case void tags #167

1.3.2.1

  • Allow xml-conduit 1.9

1.3.2

  • Fix a bug that was removing < symbols in script tags.

1.3.1

  • Inline tagstream-conduit for entity decoding in attribute value bug fix.

1.3.0

  • Upgrade to conduit 1.3

1.2.1.2

  • Remove an upper bound
  • Doc improvement

1.2.1.1

  • Allow xml-conduit 1.4

1.2.1

  • Add strict and lazy text parsing #66

1.2.0

  • Drop system-filepath

1.1.1.2

  • Fix a bug with double-unescaping of entities