extensions

package
v2.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package extensions implements various helper addons for Colly

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomMobileUserAgent

func RandomMobileUserAgent(c *colly.Collector)

RandomMobileUserAgent generates a random MOBILE browser user-agent on every requests

func RandomUserAgent

func RandomUserAgent(c *colly.Collector)

RandomUserAgent generates a random DESKTOP browser user-agent on every requests

func Referer

func Referer(c *colly.Collector)

Referer sets valid Referer HTTP header to requests. Warning: this extension works only if you use Request.Visit from callbacks instead of Collector.Visit.

func URLLengthFilter

func URLLengthFilter(c *colly.Collector, URLLengthLimit int)

URLLengthFilter filters out requests with URLs longer than URLLengthLimit

Types

type CDPDriver

type CDPDriver struct {
	// contains filtered or unexported fields
}

func ChromeDriver

func ChromeDriver() *CDPDriver

func (*CDPDriver) Cache

func (c *CDPDriver) Cache(request *http.Request, bodySize int, checkHeadersFunc colly.CheckHeadersFunc, cacheDir string) (*colly.Response, error)

func (*CDPDriver) CheckRedirect

func (c *CDPDriver) CheckRedirect(f func(req *http.Request, via []*http.Request) error)

func (*CDPDriver) Cookies

func (c *CDPDriver) Cookies(url *url.URL) []*http.Cookie

func (*CDPDriver) Do

func (c *CDPDriver) Do(request *http.Request, bodySize int, checkHeadersFunc colly.CheckHeadersFunc) (*colly.Response, error)

func (*CDPDriver) GetJar

func (c *CDPDriver) GetJar() http.CookieJar

func (*CDPDriver) GetMatchingRule

func (c *CDPDriver) GetMatchingRule(domain string) *colly.LimitRule

func (*CDPDriver) GetTimeout

func (c *CDPDriver) GetTimeout() time.Duration

func (*CDPDriver) Init

func (c *CDPDriver) Init(jar http.CookieJar)

func (*CDPDriver) Jar

func (c *CDPDriver) Jar(j http.CookieJar)

func (*CDPDriver) Limit

func (c *CDPDriver) Limit(rule *colly.LimitRule) error

func (*CDPDriver) Limits

func (c *CDPDriver) Limits(rules []*colly.LimitRule) error

func (*CDPDriver) Proxy

func (c *CDPDriver) Proxy(pf colly.ProxyFunc)

func (*CDPDriver) SetClient

func (c *CDPDriver) SetClient(client *http.Client)

func (*CDPDriver) SetCookies

func (c *CDPDriver) SetCookies(url *url.URL, cookies []*http.Cookie) error

func (*CDPDriver) Timeout

func (c *CDPDriver) Timeout(t time.Duration)

func (*CDPDriver) Transport

func (c *CDPDriver) Transport(t http.RoundTripper)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL