Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains the inner wiring for the scraping fetching strategy.
Synopsis
- data Selector = Selector {}
- data SelectorItem
- type CSSSelector = Text
- type HTMLAttribute = Text
- htmlToEntries :: ByteString -> Selector -> IO [Entry]
Documentation
Data type with the selectors to use when scraping each Entry
item.
data SelectorItem Source #
Selector to use when scraping an Entry
item.
InnerText CSSSelector | This selector will take the inner text immediately descendant of a tag selected with given css selector. |
Attr CSSSelector HTMLAttribute | This selector will take the value of given argument in the tag matched by given css selector. |
Instances
Eq SelectorItem Source # | |
Defined in Follow.Fetchers.WebScraping.Internal (==) :: SelectorItem -> SelectorItem -> Bool # (/=) :: SelectorItem -> SelectorItem -> Bool # | |
Show SelectorItem Source # | |
Defined in Follow.Fetchers.WebScraping.Internal showsPrec :: Int -> SelectorItem -> ShowS # show :: SelectorItem -> String # showList :: [SelectorItem] -> ShowS # | |
FromJSON SelectorItem # | type: text options: css: .selector or type: attr options: css: .link name: href |
Defined in Follow.Parser parseJSON :: Value -> Parser SelectorItem # parseJSONList :: Value -> Parser [SelectorItem] # |
type CSSSelector = Text Source #
A CSS2 selector.
type HTMLAttribute = Text Source #
An HTML attribute name.
htmlToEntries :: ByteString -> Selector -> IO [Entry] Source #
Converts a bytestring with HTML content to a list of entries, scraping entry items using given selector. The return type is wrapped within an IO because of the underlying vendor API.