Versions in this module Expand all Collapse all v1 v1.3.0 Mar 14, 2018 Changes in this version + const DefaultConnTimeout + const DefaultDialTimeout + const DefaultMethod + const DefaultRetryPause + const DefaultTryTimes + const PhomtomJsID + const SurfID + func AutoToUTF8(resp *http.Response) error + func BodyBytes(resp *http.Response) ([]byte, error) + func DestroyJsFiles() + func Download(req Request) (resp *http.Response, err error) + func GetWDPath() string + func IsDirExists(path string) bool + func IsFileExists(path string) bool + func UrlEncode(urlStr string) (*url.URL, error) + func WalkDir(targpath string, suffixes ...string) (dirlist []string) + type Body struct + func (b *Body) Read(p []byte) (int, error) + type Cookie struct + Domain string + Name string + Path string + Value string + type DefaultRequest struct + ConnTimeout time.Duration + DialTimeout time.Duration + DownloaderID int + EnableCookie bool + Header http.Header + Method string + PostData string + Proxy string + RedirectTimes int + RetryPause time.Duration + TryTimes int + Url string + func (self *DefaultRequest) GetConnTimeout() time.Duration + func (self *DefaultRequest) GetDialTimeout() time.Duration + func (self *DefaultRequest) GetDownloaderID() int + func (self *DefaultRequest) GetEnableCookie() bool + func (self *DefaultRequest) GetHeader() http.Header + func (self *DefaultRequest) GetMethod() string + func (self *DefaultRequest) GetPostData() string + func (self *DefaultRequest) GetProxy() string + func (self *DefaultRequest) GetRedirectTimes() int + func (self *DefaultRequest) GetRetryPause() time.Duration + func (self *DefaultRequest) GetTryTimes() int + func (self *DefaultRequest) GetUrl() string + type DnsCache struct + func (d *DnsCache) Del(addr string) + func (d *DnsCache) Query(addr string) (string, bool) + func (d *DnsCache) Reg(addr, ipPort string) + type Param struct + func NewParam(req Request) (param *Param, err error) + type Phantom struct + CookieJar *cookiejar.Jar + PhantomjsFile string + TempJsDir string + func (self *Phantom) DestroyJsFiles() + func (self *Phantom) Download(req Request) (resp *http.Response, err error) + type Request interface + GetConnTimeout func() time.Duration + GetDialTimeout func() time.Duration + GetDownloaderID func() int + GetEnableCookie func() bool + GetHeader func() http.Header + GetMethod func() string + GetPostData func() string + GetProxy func() string + GetRedirectTimes func() int + GetRetryPause func() time.Duration + GetTryTimes func() int + GetUrl func() string + type Response struct + Body string + Cookies []string + Error string + Header []struct{ ... } + type Surf struct + CookieJar *cookiejar.Jar + func (self *Surf) Download(req Request) (resp *http.Response, err error) + type Surfer interface + Download func(Request) (resp *http.Response, err error) + func New(jar ...*cookiejar.Jar) Surfer + func NewPhantom(phantomjsFile, tempJsDir string, jar ...*cookiejar.Jar) Surfer