HandsomeSoup-0.3.2: Work with HTML more easily in HXT

Safe HaskellNone

Text.HandsomeSoup

Synopsis

Documentation

openUrl :: String -> MaybeT IO StringSource

Helper function for getting page content. Example:

 contents <- runMaybeT $ openUrl "http://foo.com"

fromUrl :: String -> IOSArrow XmlTree (NTree XNode)Source

Given a url, returns a document. Example:

 doc = fromUrl "http://foo.com"
 doc = fromUrl "tests/test.html"

parseHtml :: String -> IOSArrow XmlTree (NTree XNode)Source

Given a string, parses it and returns a document. Example:

 doc = parseHtml "<h1>hello!</h1>"

(!) :: ArrowXml cat => cat a XmlTree -> String -> cat a StringSource

Shortcut for getting attributes. Example:

 doc >>> css "a" ! "href"

css :: ArrowXml a => [Char] -> a (NTree XNode) (NTree XNode)Source

A css selector for getting elements from a document. Example:

 doc >>> css "#menu li"