| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Follow.Fetchers.WebScraping.Internal
Description
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.
Constructors
| Selector | |
Fields | |
data SelectorItem Source #
Selector to use when scraping an Entry item.
Constructors
| 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 | |
| Show SelectorItem Source # | |
Defined in Follow.Fetchers.WebScraping.Internal Methods 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 | |
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.