shpider-0.0.2: Web automation library in Haskell.Source codeContentsIndex
Network.Shpider.Forms
Synopsis
module Network.Shpider.Pairs
data Form = Form {
method :: Method
action :: String
inputs :: Map String String
}
data Method
= GET
| POST
gatherForms :: [Tag] -> [Form]
fillOutForm :: Form -> [(String, String)] -> Form
allForms :: TagParser [Form]
toForm :: WholeTag -> Maybe Form
mkForm :: String -> Method -> [(String, String)] -> Form
Documentation
module Network.Shpider.Pairs
data Form Source
Plain old form: Method, action and inputs.
Constructors
Form
method :: Method
action :: String
inputs :: Map String String
show/hide Instances
data Method Source
Either GET or POST.
Constructors
GET
POST
show/hide Instances
gatherForms :: [Tag] -> [Form]Source
Gets all forms from a list of tags.
fillOutForm :: Form -> [(String, String)] -> FormSource

Takes a form and fills out the inputs with the given [ ( String , String ) ]. It is convienent to use the pairs syntax here.

 f : _ <- getFormsByAction "http://whatever.com"
 sendForm $ fillOutForm f $ pairs $ do
    "author" =: "Johnny"
    "message" =: "Nice syntax dewd."
allForms :: TagParser [Form]Source
The TagParser which parses all forms.
toForm :: WholeTag -> Maybe FormSource
mkForm :: String -> Method -> [(String, String)] -> FormSource
The first argument is the action attribute of the form, the second is the method attribute, and the third are the inputs.
Produced by Haddock version 2.4.2