Documentation ¶
Index ¶
- Variables
- func AddDefaultOptions(option ...chromedp.ExecAllocatorOption)
- func CancelGlobalCtx()
- func CreateOptions(opts ...chromedp.ExecAllocatorOption) []chromedp.ExecAllocatorOption
- func GetGlobalCtx() context.Context
- func GetRandUserAgent() string
- func NewExecAllocator(tasks chromedp.Tasks, opts ...chromedp.ExecAllocatorOption) error
- func NewExecCtx(opts ...chromedp.ExecAllocatorOption) (context.Context, context.CancelFunc)
- func NewExecRemoteCtx(remoteWs string, opts ...chromedp.ExecAllocatorOption) (context.Context, context.CancelFunc)
- func NewGlobalCtx()
- func RequestByCookie(ctx context.Context, req *http.Request, isDisableRedirects bool) (*http.Response, error)
- func WaitAction(wait sync.WaitGroup) chromedp.ActionFunc
- func WaitDocumentUpdated(ctx context.Context) (<-chan struct{}, context.CancelFunc)
- type GlobalBackgroundCtx
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = []chromedp.ExecAllocatorOption{ chromedp.Flag("headless", false), chromedp.Flag("hide-scrollbars", false), chromedp.Flag("mute-audio", true), chromedp.Flag("disable-infobars", true), chromedp.Flag("enable-automation", false), chromedp.Flag("start-maximized", true), chromedp.Flag("disable-default-apps", false), chromedp.Flag("no-sandbox", false), chromedp.Flag("disable-extensions", false), chromedp.Flag("disable-plugins", false), chromedp.NoDefaultBrowserCheck, chromedp.NoFirstRun, }
View Source
var UserAgent = []string{
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0",
"Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; rv:11.0) like Gecko",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.84",
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36 LBBROWSER",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3676.400 QQBrowser/10.4.3473.400",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.2500",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 BIDUBrowser/8.7 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 QIHU 360EE",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1)",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
}
Functions ¶
func AddDefaultOptions ¶
func AddDefaultOptions(option ...chromedp.ExecAllocatorOption)
func CancelGlobalCtx ¶
func CancelGlobalCtx()
func CreateOptions ¶
func CreateOptions(opts ...chromedp.ExecAllocatorOption) []chromedp.ExecAllocatorOption
func GetGlobalCtx ¶
func GetRandUserAgent ¶
func GetRandUserAgent() string
func NewExecAllocator ¶
func NewExecAllocator(tasks chromedp.Tasks, opts ...chromedp.ExecAllocatorOption) error
func NewExecCtx ¶
func NewExecCtx(opts ...chromedp.ExecAllocatorOption) (context.Context, context.CancelFunc)
func NewExecRemoteCtx ¶
func NewExecRemoteCtx(remoteWs string, opts ...chromedp.ExecAllocatorOption) (context.Context, context.CancelFunc)
func NewGlobalCtx ¶
func NewGlobalCtx()
func RequestByCookie ¶
func WaitDocumentUpdated ¶
func WaitDocumentUpdated(ctx context.Context) (<-chan struct{}, context.CancelFunc)
Types ¶
type GlobalBackgroundCtx ¶
type GlobalBackgroundCtx struct { Cancel context.CancelFunc // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.