Safe Haskell | Safe-Infered |
---|
Scraping (innerHTML/innerText) and modification (node removal) functions.
- innerHtml :: [Cursor] -> Text
- innerText :: [Cursor] -> Text
- renderNodes :: [Node] -> Text
- toHtml :: [Cursor] -> Text
- innerTextN :: Node -> Text
- ename :: Node -> Maybe Text
- eid :: Node -> Maybe Text
- eclass :: Node -> [Text]
- getMeta :: Text -> Cursor -> [Text]
- remove :: (Node -> Bool) -> Node -> Node
- removeDepth :: (Node -> Bool) -> Int -> Node -> Node
- removeTags :: [Text] -> [Node] -> [Node]
- removeQuery :: String -> [Node] -> [Node]
- removeQueries :: [String] -> [Node] -> [Node]
- nodeHaving :: (Node -> Bool) -> Node -> Bool
- rmElem :: String -> String -> [String] -> [Node] -> [Node]
InnerHTML / InnerText
renderNodes :: [Node] -> TextSource
''toHTML'' of a list of nodes.
innerTextN :: Node -> TextSource
''innerText'' of a single node.
Attirbutes
ename :: Node -> Maybe TextSource
Tag name of element node. Return Nothing if the node is not an element.
eid :: Node -> Maybe TextSource
Return an element id. If node is not an element or does not have an id, return Nothing.
eclass :: Node -> [Text]Source
Return element classes. If node is not an element or does not have a class, return an empty list.
getMeta :: Text -> Cursor -> [Text]Source
Search a meta with a specified name under a cursor, and get a ''content'' field.
Removing Nodes
remove :: (Node -> Bool) -> Node -> NodeSource
Remove descendant nodes that satisfie predicate (''Destructive'').
removeTags :: [Text] -> [Node] -> [Node]Source
Remove elements with specified tags.
removeQuery :: String -> [Node] -> [Node]Source
Remove descendant nodes that match a query string.
removeQueries :: [String] -> [Node] -> [Node]Source
Remove descendant nodes that match any of query strings.