Documentation ¶
Index ¶
- Constants
- type Closeable
- type IPage
- type IRequest
- type IResultItems
- type Page
- func (this *Page) AddTargetRequestUrls(urlStrs ...string)
- func (this *Page) AddTargetRequests(requests ...IRequest)
- func (this *Page) GetCharset() string
- func (this *Page) GetDocument() *goquery.Document
- func (this *Page) GetHtmlNode() *selector.HtmlNode
- func (this *Page) GetRawText() string
- func (this *Page) GetRequest() IRequest
- func (this *Page) GetRespHeaders() map[string][]string
- func (this *Page) GetResultItems() IResultItems
- func (this *Page) GetStatusCode() int
- func (this *Page) GetTargetRequests() []IRequest
- func (this *Page) GetUrl() *selector.PlainText
- func (this *Page) StoreField(key string, obj interface{})
- type Request
- func (this *Request) GetCharset() string
- func (this *Request) GetCookies() map[string]string
- func (this *Request) GetExtras() map[string]interface{}
- func (this *Request) GetHeaders() map[string][]string
- func (this *Request) GetMethod() string
- func (this *Request) GetPriority() int64
- func (this *Request) GetUrl() string
- func (this *Request) IsRetry() bool
- func (this *Request) IsUseProxy() bool
- func (this *Request) PutCookie(key, value string) IRequest
- func (this *Request) PutExtra(key string, value interface{}) IRequest
- func (this *Request) PutHeader(key string, value []string) IRequest
- func (this *Request) SetCharset(charset string) IRequest
- func (this *Request) SetCookies(cookies map[string]string) IRequest
- func (this *Request) SetExtras(extras map[string]interface{}) IRequest
- func (this *Request) SetHeaders(headers map[string][]string) IRequest
- func (this *Request) SetMethod(method string) IRequest
- func (this *Request) SetPriority(priority int64) IRequest
- func (this *Request) SetUseProxy(use bool) IRequest
- type ResultItems
Constants ¶
View Source
const CycleTriedTimes = "__cycle_tried_times"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPage ¶
type IPage interface { GetRequest() IRequest GetDocument() *goquery.Document GetHtmlNode() *selector.HtmlNode GetCharset() string GetStatusCode() int AddTargetRequestUrls(url ...string) AddTargetRequests(request ...IRequest) GetTargetRequests() []IRequest GetRespHeaders() map[string][]string GetUrl() *selector.PlainText StoreField(key string, obj interface{}) GetResultItems() IResultItems GetRawText() string }
represent a html page, all methods are not thread safe.
type IRequest ¶
type IRequest interface { GetUrl() string GetMethod() string SetMethod(method string) IRequest GetExtras() map[string]interface{} SetExtras(extras map[string]interface{}) IRequest PutExtra(key string, value interface{}) IRequest GetCookies() map[string]string SetCookies(cookies map[string]string) IRequest PutCookie(key, value string) IRequest GetHeaders() map[string][]string SetHeaders(headers map[string][]string) IRequest PutHeader(key string, value []string) IRequest GetPriority() int64 SetPriority(priority int64) IRequest GetCharset() string SetCharset(charset string) IRequest IsUseProxy() bool SetUseProxy(use bool) IRequest IsRetry() bool //this request is retry action }
func NewRequest ¶
type IResultItems ¶
type Page ¶
type Page struct { Request IRequest Document *goquery.Document HtmlRootNode *selector.HtmlNode Charset string Status int TargetRequests []IRequest RespHeaders map[string][]string Url *selector.PlainText // contains filtered or unexported fields }
func (*Page) AddTargetRequestUrls ¶
add raw request url
func (*Page) AddTargetRequests ¶
add request
func (*Page) GetCharset ¶
func (*Page) GetDocument ¶
func (*Page) GetHtmlNode ¶
func (*Page) GetRawText ¶
func (*Page) GetRequest ¶
func (*Page) GetRespHeaders ¶
func (*Page) GetResultItems ¶
func (this *Page) GetResultItems() IResultItems
func (*Page) GetStatusCode ¶
func (*Page) GetTargetRequests ¶
func (*Page) StoreField ¶
type Request ¶
type Request struct { Url string Method string Extras map[string]interface{} Cookies map[string]string Headers map[string][]string Priority int64 Charset string UseProxy bool }
func (*Request) GetCharset ¶
func (*Request) GetCookies ¶
func (*Request) GetHeaders ¶
func (*Request) GetPriority ¶
func (*Request) IsUseProxy ¶
func (*Request) SetCharset ¶
func (*Request) SetPriority ¶
func (*Request) SetUseProxy ¶
type ResultItems ¶
func NewResultItems ¶
func NewResultItems(skip bool) *ResultItems
func (*ResultItems) All ¶
func (this *ResultItems) All() map[string]interface{}
func (*ResultItems) Get ¶
func (this *ResultItems) Get(key string) interface{}
func (*ResultItems) IsSkip ¶
func (this *ResultItems) IsSkip() bool
func (*ResultItems) Put ¶
func (this *ResultItems) Put(key string, value interface{})
Click to show internal directories.
Click to hide internal directories.