follow-0.1.0.0: Haskell library to follow content published on any subject.

Safe HaskellNone
LanguageHaskell2010

Follow.Fetchers.WebScraping.Internal

Description

This module contains the inner wiring for the scraping fetching strategy.

Synopsis

Documentation

data Selector Source #

Data type with the selectors to use when scraping each Entry item.

Instances
Eq Selector Source # 
Instance details

Defined in Follow.Fetchers.WebScraping.Internal

Show Selector Source # 
Instance details

Defined in Follow.Fetchers.WebScraping.Internal

FromJSON Selector #
  uri: # See SelectorItem instance
  title: null
  description: null
  guid: null
  author: null
  publish_date: null
 
Instance details

Defined in Follow.Parser

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 # 
Instance details

Defined in Follow.Fetchers.WebScraping.Internal

Show SelectorItem Source # 
Instance details

Defined in Follow.Fetchers.WebScraping.Internal

FromJSON SelectorItem #
  type: text
  options:
    css: .selector
  

or

  type: attr
  options:
    css: .link
    name: href
  
Instance details

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.