Documentation ¶
Overview ¶
A grawl browser can load pages and submit forms found on those pages.
Index ¶
- Constants
- func FixProtocol(url string) string
- type Browser
- func (b *Browser) ClearCookies()
- func (b *Browser) GetCookies() []*http.Cookie
- func (b *Browser) GetUserAgent() string
- func (b *Browser) Load(url string) *element.Page
- func (b *Browser) LoadFile(fileName string) *element.Page
- func (b *Browser) RelToAbs(relUrl string) string
- func (b *Browser) SetCookie(cookie *http.Cookie)
- func (b *Browser) SetUserAgent(agent string)
- func (b *Browser) SubmitForm(form *element.Form) *element.Page
Constants ¶
View Source
const (
UAgent string = "Grawl v0.1"
)
Variables ¶
This section is empty.
Functions ¶
func FixProtocol ¶
prepends http:// to the start of urls which are missing a protocol
Types ¶
type Browser ¶
func NewBrowserWithClient ¶
Create a grawl browser using a predefined http client
func (*Browser) ClearCookies ¶
func (b *Browser) ClearCookies()
func (*Browser) GetCookies ¶
func (*Browser) GetUserAgent ¶
Return the user agent the browser is currently using in requests
func (*Browser) RelToAbs ¶
Convert a relative url to an absolute url based on the browsers currently loaded page url
func (*Browser) SetUserAgent ¶
Set the user agent to be used in browser requests
Click to show internal directories.
Click to hide internal directories.