Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Cookies(url *url.URL) []*http.Cookie
- func (c *Client) Get(addr string) (tame.Document, error)
- func (c *Client) GetCookie(url *url.URL, name string) (string, bool)
- func (c *Client) NewRequest(method, addr string, body io.Reader) (*http.Request, error)
- func (c *Client) SetCookies(url *url.URL, cookies []*http.Cookie)
Constants ¶
This section is empty.
Variables ¶
View Source
var CommonUserAgents = []string{
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8",
"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
}
CommonUserAgents contains list of user agents.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // User-Agent, used by this client UserAgent string // HTTP Referer Referer string // Ray is xray.Ray logger Ray xray.Ray // Other HTTP headers Header map[string]string // contains filtered or unexported fields }
Client represents new HTTP user session
func (*Client) Cookies ¶
Cookies returns the cookies to send in a request for the given URL. It is up to the implementation to honor the standard cookie use restrictions such as in RFC 6265.
func (*Client) NewRequest ¶
NewRequest builds and returns new request of desired type with headers injected
Click to show internal directories.
Click to hide internal directories.