hScraper-0.1.0.0: A Haskell library to scrape and crawl web-pages

Safe HaskellSafe
LanguageHaskell2010

HScraper.Query

Description

A simple Query format to query the HTMLTree.

The Syntax is as follows : "nodeName[Class(optional)]{ID(optional)} > nodeName[Class(optional)]{ID(optional)}"

eg : "div{id1} > span[class][id_h1] > a"

Synopsis

Documentation

(|>>) :: HTMLTree -> Query -> [HTMLTree] Source

Applies >=> considering each node as root and combines the result.

(>=>) :: HTMLTree -> Query -> [HTMLTree] Source

Returns the list of nodes matching the query with root matching the first NodeQuery, and subsequent Children satisfying subsequent NodeQueries continously.

getText :: HTMLTree -> Text Source

Get Combined Text of immediate children of current node.

getEntireText :: HTMLTree -> Text Source

Get Entire text contained in the subtree.

getAttribute :: String -> HTMLTree -> Maybe String Source

Get the value of an attribute of a node.