Documentation ¶
Index ¶
- func RandomMobileUserAgent(r *Request)
- func RandomUserAgent(r *Request)
- func Text(selection *goquery.Selection) string
- type ErrorCallback
- type Handler
- func (h *Handler) AddRequest(req *Request)
- func (h *Handler) AddURL(ctx context.Context, url string) error
- func (h *Handler) AddURLWithContext(url string, ctx context.Context) error
- func (h *Handler) OnError(callback ErrorCallback)
- func (h *Handler) OnHtml(callback HtmlCallback)
- func (h *Handler) OnRequest(callback RequestCallback)
- func (h *Handler) OnResponse(callback ResponseCallback)
- type HtmlCallback
- type Request
- type RequestCallback
- type RequestQueue
- type ResponseCallback
- type Scrapy
- type ScrapyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomMobileUserAgent ¶
func RandomMobileUserAgent(r *Request)
func RandomUserAgent ¶
func RandomUserAgent(r *Request)
Types ¶
type ErrorCallback ¶
type Handler ¶
type Handler struct { Priority int // contains filtered or unexported fields }
func NewHandler ¶
func NewHandler() *Handler
func (*Handler) AddRequest ¶
func (*Handler) AddURLWithContext ¶
func (*Handler) OnError ¶
func (h *Handler) OnError(callback ErrorCallback)
func (*Handler) OnHtml ¶
func (h *Handler) OnHtml(callback HtmlCallback)
func (*Handler) OnRequest ¶
func (h *Handler) OnRequest(callback RequestCallback)
func (*Handler) OnResponse ¶
func (h *Handler) OnResponse(callback ResponseCallback)
type Request ¶
type Request struct { Request *http.Request Ctx context.Context // contains filtered or unexported fields }
Request...
type RequestCallback ¶
type RequestCallback func(*Request)
type RequestQueue ¶
type RequestQueue struct {
// contains filtered or unexported fields
}
func NewQueue ¶
func NewQueue(cap int) *RequestQueue
func (*RequestQueue) Len ¶
func (r *RequestQueue) Len() int
func (*RequestQueue) PopRequest ¶
func (r *RequestQueue) PopRequest() *Request
func (*RequestQueue) PushRequest ¶
func (r *RequestQueue) PushRequest(req *Request)
type ResponseCallback ¶
type Scrapy ¶
type Scrapy struct { Client *http.Client Threads int Timeout time.Duration Queue *RequestQueue // contains filtered or unexported fields }
func (*Scrapy) AddHandler ¶
func (*Scrapy) ShutdownAfter ¶
type ScrapyOptions ¶
type ScrapyOptions func(*Scrapy)
ScrapyOptions...
func SetTimeout ¶
func SetTimeout(timeout time.Duration) ScrapyOptions
Click to show internal directories.
Click to hide internal directories.