forms

package
v0.0.0-...-a1d1ef6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2017 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package forms implements helpers for filling forms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	Action string
	Values url.Values
	// contains filtered or unexported fields
}

Form - Form structure.

func New

func New(page ...*crawl.Response) (form *Form)

New - Creates new form. Page argument is a list because it's optional - only first argument is used.

func NewSelector

func NewSelector(page *crawl.Response, selector string) (form *Form)

NewSelector - Creates new form with selector.

func (*Form) Page

func (form *Form) Page(page *crawl.Response)

Page - Sets html page containing form. It is used in Selector() for setting default form values and in Select() for finding select node in a form.

func (*Form) Select

func (form *Form) Select(name, text string) (ok bool)

Select - Sets value for input of type select Value is chosen by option's text (trimmed of space). Returns ok when value was set.

func (*Form) Selector

func (form *Form) Selector(selector string)

Selector - Sets form selector and parses default values. At this point page has to be set using Page() method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL