gheadless

package
v0.0.0-...-04ff805 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskScreenshot = "screenshot"
	TaskFullHtml   = "full-html"
)

Functions

func ScreenShot

func ScreenShot(urlStr, path string) error

Types

type Chrome

type Chrome struct {
	Resolution       string
	ChromeTimeout    int
	ChromeTimeBudget int
	Path             string
	UserAgent        string
	Argvs            []string

	ScreenshotPath string
}

Chrome contains information about a Google Chrome instance, with methods to run on it.

func New

func New() *Chrome

func (*Chrome) ScreenshotURL

func (chrome *Chrome) ScreenshotURL(targetURL *url.URL, destination string) error

ScreenshotURL takes a screenshot of a URL

func (*Chrome) SetScreenshotPath

func (chrome *Chrome) SetScreenshotPath(p string) error

SetScreenshotPath sets the path for screenshots

func (*Chrome) Setup

func (chrome *Chrome) Setup()

Setup configures a Chrome struct with the path specified to what is available on this system.

type ChromeDP

type ChromeDP struct {
}

func NewChromeDP

func NewChromeDP() *ChromeDP

func (*ChromeDP) DoTask

func (ch *ChromeDP) DoTask(urlStr, proxy string, tasks []string, log glog.Interface, timeout time.Duration) (map[string][]byte, error)

func (*ChromeDP) GetFullHtml

func (ch *ChromeDP) GetFullHtml(urlStr, proxy string, log glog.Interface, timeout time.Duration) ([]byte, error)

func (*ChromeDP) Screenshot

func (ch *ChromeDP) Screenshot(urlStr, proxy string, log glog.Interface, timeout time.Duration) ([]byte, error)

Jump to

Keyboard shortcuts

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