capture

package
v0.0.33 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserPageCapturer

type BrowserPageCapturer struct {
	PathToBrowser              *string
	Browser                    *rod.Browser
	TimeoutSeconds             int
	MinDOMStabalizeTimeSeconds int
}

func NewBrowserPageCapturer

func NewBrowserPageCapturer(pathToBrowser *string, timeout int, minDOMStabalizeTime int) *BrowserPageCapturer

func NewBrowserPageCapturerWithClient

func NewBrowserPageCapturerWithClient(client *cdp.Client, timeout int, minDOMStabalizeTime int) *BrowserPageCapturer

func (*BrowserPageCapturer) Capture

func (b *BrowserPageCapturer) Capture(ctx context.Context, url string, options *Options) (*Result, error)

func (*BrowserPageCapturer) CaptureScreenshot

func (b *BrowserPageCapturer) CaptureScreenshot(ctx context.Context, url string, options *Options) webscan.PageScreenshotReport

func (*BrowserPageCapturer) Close

func (b *BrowserPageCapturer) Close(ctx context.Context) error

func (*BrowserPageCapturer) InitializeBrowser

func (b *BrowserPageCapturer) InitializeBrowser()

type BrowserbasePageCapturer

type BrowserbasePageCapturer struct {
	Client   *browserbase.Client
	Capturer *BrowserPageCapturer
}

func NewBrowserbasePageCapturer

func NewBrowserbasePageCapturer(
	ctx context.Context,
	timeout int,
	minDOMStabalizeTime int,
	browserbaseClient *browserbase.Client,
) *BrowserbasePageCapturer

func (*BrowserbasePageCapturer) Capture

func (b *BrowserbasePageCapturer) Capture(ctx context.Context, url string, options *Options) (*Result, error)

func (*BrowserbasePageCapturer) CaptureScreenshot added in v0.0.26

func (b *BrowserbasePageCapturer) CaptureScreenshot(ctx context.Context, url string, options *Options) webscan.PageScreenshotReport

func (*BrowserbasePageCapturer) Close

type Options

type Options struct{}

type PageCapturer

type PageCapturer interface {
	Capture(ctx context.Context, url string, options *Options) (*Result, error)
	Close(ctx context.Context) error
}

type RequestPageCapturer

type RequestPageCapturer struct {
	Client http.Client
}

func NewRequestPageCapturer

func NewRequestPageCapturer(insecure bool, timeout int) *RequestPageCapturer

func (*RequestPageCapturer) Capture

func (r *RequestPageCapturer) Capture(ctx context.Context, url string, options *Options) (*Result, error)

func (*RequestPageCapturer) Close

func (r *RequestPageCapturer) Close(ctx context.Context) error

type Result

type Result struct {
	Content    []byte   `json:"content,omitempty" yaml:"content,omitempty"`
	StatusCode *int     `json:"statusCode,omitempty" yaml:"statusCode,omitempty"`
	URL        string   `json:"url,omitempty" yaml:"url,omitempty"`
	Errors     []string `json:"errors,omitempty" yaml:"errors,omitempty"`
}

func NewCaptureResult

func NewCaptureResult(URL string) *Result

func (*Result) ToPageCaptureReport

func (r *Result) ToPageCaptureReport() webscan.PageCaptureReport

type WebSocket

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

func NewWebSocket

func NewWebSocket(ctx context.Context, url string) *WebSocket

func (*WebSocket) Read

func (w *WebSocket) Read() ([]byte, error)

func (*WebSocket) Send

func (w *WebSocket) Send(b []byte) error

Jump to

Keyboard shortcuts

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