shpider-0.2.1.1: Web automation library in Haskell.

Network.Shpider.State

Description

This module describes the state of shpider computations, and provides a monad transformer over it.

Synopsis

Documentation

data ShpiderState Source

The shpider state holds all the options for shpider transactions, the current page and all the CurlOptions used when calling curl.

Constructors

SS 

Fields

htmlOnlyDownloads :: Bool
 
startPage :: String
 
dontLeaveDomain :: Bool
 
curlOpts :: [CurlOption]
 
currentPage :: Page
 
visited :: Maybe [String]
 
downloadThrottle :: Maybe Int

Whether to wait at least N micro-seconds between downloads or form submissions. Defaults to Nothing.

lastDownloadTime :: Maybe UTCTime
 

Instances

data Page Source

The Page datatype. Holds Links, Forms, the parsed [ Tag ], the page source, and the page's absolute URL.

Constructors

Page 

Fields

links :: [Link]
 
forms :: [Form]
 
tags :: [Tag String]
 
source :: String
 
addr :: String
 

Instances

type Shpider = StateT ShpiderState IOSource

The type of Shpider computations. A state transformer over ShpiderState and IO.

emptyPage :: PageSource

An empty page, containing no information.

runShpider :: Shpider a -> IO aSource

Run a Shpider computation, returning the result.

runShpiderSt :: Shpider a -> IO (a, ShpiderState)Source

Run a Shpider computation, returning the result with the state.