shpider-0.2.1.1: Web automation library in Haskell.

Network.Shpider.Forms

Synopsis

Documentation

data Form Source

Plain old form: Method, action and inputs.

Constructors

Form 

Instances

data Method Source

Either GET or POST.

Constructors

GET 
POST 

Instances

gatherForms :: [Tag String] -> [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 String [Form]Source

The TagParser which parses all forms.

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.