browser

package
v0.0.0-...-dc1fca4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const UserAgentChrome = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"

Variables

This section is empty.

Functions

func AbsoluteURL

func AbsoluteURL(pathOrURL string, u *url.URL) string

Types

type Browser

type Browser struct {
	Logger
	*http.Client
	*http.Response
	// contains filtered or unexported fields
}

func New

func New() (*Browser, error)

func (*Browser) Body

func (b *Browser) Body() ([]byte, error)

func (*Browser) Close

func (b *Browser) Close() error

func (*Browser) Do

func (b *Browser) Do(req *http.Request) error

func (*Browser) Forms

func (b *Browser) Forms() ([]*Form, error)

func (*Browser) Printf

func (b *Browser) Printf(format string, v ...interface{})

func (*Browser) SaveToFile

func (b *Browser) SaveToFile(path string) error

func (*Browser) Submit

func (b *Browser) Submit(form *Form) error

func (*Browser) UserAgent

func (b *Browser) UserAgent(ua string)

func (*Browser) Visit

func (b *Browser) Visit(url string) error

type Form

type Form struct {
	Action string
	Method string

	Inputs []*Input
}

func (*Form) FillIn

func (f *Form) FillIn(name string, value string) error

type Input

type Input struct {
	Type    string
	Name    string
	Value   string
	Checked bool
}

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

Jump to

Keyboard shortcuts

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