Documentation ¶
Index ¶
- type Arg
- type CdpHelper
- func (h *CdpHelper) Attributes(sel any, opts ...chromedp.QueryOption) (map[string]string, error)
- func (h *CdpHelper) AttributesAll(sel any, opts ...chromedp.QueryOption) ([]map[string]string, error)
- func (h *CdpHelper) ChildNode(ctx context.Context, parent cdp.NodeID, cssSel string) (context.Context, cdp.NodeID, error)
- func (h *CdpHelper) ChildNodeTextContent(parent *cdp.Node, cssSel string) (string, error)
- func (h *CdpHelper) ChildNodes(parent *cdp.Node, cssSel string) ([]cdp.NodeID, error)
- func (h *CdpHelper) Click(sel any, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) ClickChild(parent *cdp.Node, cssSel string, opts ...chromedp.MouseOption) error
- func (h *CdpHelper) ComputedStyle(sel any, opts ...chromedp.QueryOption) (map[string]string, error)
- func (h *CdpHelper) Download(path string, isNewTarget bool) (*chan string, context.Context, func(), error)
- func (h *CdpHelper) FullScreen() error
- func (h *CdpHelper) HasChildNode(parent *cdp.Node, cssSel string) (cdp.NodeID, bool)
- func (h *CdpHelper) ListenRequest(uri string) chan []byte
- func (h *CdpHelper) Navigate(url string) error
- func (h *CdpHelper) NavigateWithTimeout(url string, timeout time.Duration) error
- func (h *CdpHelper) NewBlankTab(targetId string) (*CdpHelper, error)
- func (h *CdpHelper) NewBrowserExecutor(ctx context.Context) context.Context
- func (h *CdpHelper) NewTargetExecutor(ctx context.Context) context.Context
- func (h *CdpHelper) NodeTextContent(sel any, opts ...chromedp.QueryOption) (string, error)
- func (h *CdpHelper) Nodes(sel any, opts ...chromedp.QueryOption) ([]*cdp.Node, error)
- func (h *CdpHelper) Run(actions ...chromedp.Action) error
- func (h *CdpHelper) RunWithTimeout(t time.Duration, actions ...chromedp.Action) error
- func (h *CdpHelper) ScreenShot(dir string, filename string) error
- func (h *CdpHelper) SendKeys(sel any, v string, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) SetAttributeValue(sel any, name string, value string, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) SetAttributes(sel any, attributes map[string]string, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) Sleep(d time.Duration) error
- func (h *CdpHelper) Tasks(actions ...chromedp.Action) error
- func (h *CdpHelper) Upload(sel any, files []string, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) WaitReady(sel any, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) WaitReadyWithTimeout(timeout time.Duration, sel any, opts ...chromedp.QueryOption) error
- func (h *CdpHelper) WithTextTimeout(timeout time.Duration)
- func (h *CdpHelper) WithTimeout(timeout time.Duration)
- type ContextWithCancel
- type DefaultLogger
- type Job
- type Logger
- type RemoteBrowserOption
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CdpHelper ¶
type CdpHelper struct { // Allocator represents chromedp allocator with cancel func Allocator ContextWithCancel Browser ContextWithCancel Current *ContextWithCancel Timeout time.Duration TextTimeout time.Duration DownloadTimeout time.Duration EnableScreenshot bool }
func NewBrowser ¶
func NewRemoteBrowser ¶
func NewRemoteBrowser(option RemoteBrowserOption) *CdpHelper
func (*CdpHelper) Attributes ¶
func (*CdpHelper) AttributesAll ¶
func (*CdpHelper) ChildNodeTextContent ¶ added in v0.9.10
func (*CdpHelper) ChildNodes ¶ added in v0.9.5
func (*CdpHelper) ClickChild ¶ added in v0.9.4
func (*CdpHelper) ComputedStyle ¶ added in v0.9.11
func (*CdpHelper) FullScreen ¶ added in v0.9.21
func (*CdpHelper) HasChildNode ¶ added in v0.9.6
func (*CdpHelper) ListenRequest ¶ added in v0.9.21
func (*CdpHelper) NavigateWithTimeout ¶ added in v0.9.20
func (*CdpHelper) NewBlankTab ¶
NewBlankTab returns a new CdpHelper instance, and CdpHelper.Current points to the new tab
func (*CdpHelper) NewBrowserExecutor ¶ added in v0.9.4
func (*CdpHelper) NewTargetExecutor ¶ added in v0.9.4
func (*CdpHelper) NodeTextContent ¶ added in v0.9.10
func (*CdpHelper) RunWithTimeout ¶ added in v0.9.1
func (*CdpHelper) ScreenShot ¶ added in v0.9.12
func (*CdpHelper) SetAttributeValue ¶
func (*CdpHelper) SetAttributes ¶
func (*CdpHelper) WaitReady ¶
func (h *CdpHelper) WaitReady(sel any, opts ...chromedp.QueryOption) error
func (*CdpHelper) WaitReadyWithTimeout ¶ added in v0.9.15
func (*CdpHelper) WithTextTimeout ¶
func (*CdpHelper) WithTimeout ¶
type ContextWithCancel ¶
type ContextWithCancel struct { Context context.Context Cancel context.CancelFunc }
type DefaultLogger ¶
type DefaultLogger struct { }
func (*DefaultLogger) Debugf ¶
func (*DefaultLogger) Debugf(format string, args ...any)
func (*DefaultLogger) Errorf ¶
func (*DefaultLogger) Errorf(format string, args ...any)
func (*DefaultLogger) Logf ¶
func (*DefaultLogger) Logf(format string, args ...any)
type RemoteBrowserOption ¶ added in v0.9.17
type Scheduler ¶
type Scheduler struct { PrevRetry bool // whether retry in prev phase PrevRetryTimes int // prev phase retry times PrevRetryInterval time.Duration // prev phase retry interval ErrRetry bool // whether retry when error occur ErrRetryTimes int // retry times when error occur Concurrent bool // execute do function concurrently WaitStep int Done chan any Timeout time.Duration // contains filtered or unexported fields }
func NewScheduler ¶
func NewScheduler() *Scheduler
Click to show internal directories.
Click to hide internal directories.