Documentation ¶
Index ¶
- func BreakSimpleCaptcha(image io.Reader) (string, error)
- func DumpHTML(node xml.Node, filename string)
- func First(node xml.Node, expression string) (xml.Node, error)
- func URLValues(parameters map[string]string) url.Values
- type Client
- func (client *Client) OpenPage(url string, formData url.Values) ([]byte, error)
- func (client *Client) ParsePage(url string, formData url.Values) (*htmlParser.HtmlDocument, error)
- func (client *Client) ParsePageWithEncoding(url string, formData url.Values, encoding []byte) (*htmlParser.HtmlDocument, error)
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BreakSimpleCaptcha ¶
BreakSimpleCaptcha uses the tesseract OCR command to recognise text in a simple captcha
Types ¶
type Client ¶
Client wraps a http client with error handling and retries
func NewCookiedClient ¶
NewCookiedClient initialises a client with a cookie jar. It will store cookies between requests.
func (*Client) OpenPage ¶
OpenPage reads the web page at the given url. It performs a GET request if formData is nil, and a POST request otherwise.
func (*Client) ParsePage ¶
func (client *Client) ParsePage( url string, formData url.Values, ) (*htmlParser.HtmlDocument, error)
ParsePage parses a html page at the given URL. It performs a GET request if formData is nil, and a POST request otherwise.
func (*Client) ParsePageWithEncoding ¶
func (client *Client) ParsePageWithEncoding( url string, formData url.Values, encoding []byte, ) (*htmlParser.HtmlDocument, error)
ParsePage parses a html page at the given URL. It performs a GET request if formData is nil, and a POST request otherwise. Uses the specified encoding to decode the given page
type Settings ¶
type Settings struct { Transport http.RoundTripper Timeout time.Duration MaxHttpRetries int MaxServerErrorRetries int HttpRetryInterval time.Duration ServerErrorRetryInterval time.Duration Encoding []byte }
Settings contains settings for making http connections
func SensibleSettings ¶
func SensibleSettings() *Settings
SensibleSettings returns a Settings object initialised with sensible defaults