goundetectedchromedriver

package module
v0.0.0-...-66faa24 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

go undetected chromedriver

This pacakge is a Go rewrite of the one and only undetected-chromedriver.

WIP

Documentation

Overview

Package goundetectedchromedriver provides a chrome driver.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChromeNotFound = errors.New("chrome executable not found, please install or provide a path")
)

Errors.

Functions

This section is empty.

Types

type Chrome

type Chrome struct {
	selenium.WebDriver
	// contains filtered or unexported fields
}

Chrome implements a webdriver that is connected the undetected chromedriver.

func NewChromeDriver

func NewChromeDriver(opts ...Option) (Chrome, error)

NewChromeDriver creates a new webdriver instance connected to the undetected chromedriver.

func (*Chrome) Get

func (c *Chrome) Get(url string) error

Get navigates the browser to the provided URL.

type Config

type Config struct {
	// DriverExecutable can optionally be set to provide a custom driver.
	// If the driver is not patched yet it will be patched automatically.
	DriverExecutable string

	BrowserExecurable string

	UserDataDir string

	// Port is the port the chromedriver will listen on
	Port int

	// DebuggerAddress is the address the chrome debugger will listen on
	DebuggerAddress string

	// ChromeArgs are additional arguments to pass to chrome.
	//
	// Note that if you provide options that will be set already, the will be
	// set twice.
	ChromeArgs []string

	// DriverArgs are additional arguments to pass to the chromedriver.
	//
	// To set a custom port, use the port argument instead of an arg here.
	DriverArgs []string

	// Language locale to pass to chrome. e.g.'en-US'
	Language string

	SuppressWelcome bool
	KeepAlive       bool
	LogLevel        int
	Headless        bool
	// Version is the main chromedriver version to use, e.g. 107.
	Version       int
	Debug         bool
	UseSubprocess bool // check this
	Sandbox       bool

	// Do we need these?
	EnableCDPEvents      bool
	ServiceArgs          []any
	ServiceCreationFlags []any
	ServiceLogPath       string
	AdvancedElements     bool
	PatcherForceClose    bool
}

Config for Chrome config.

func NewConfig

func NewConfig(opts ...Option) Config

NewConfig creates new config object.

type Option

type Option func(*Config)

Option is a functional option type.

func WithDebug

func WithDebug() Option

WithDebug sets the debug option.

func WithUserDataDir

func WithUserDataDir(path string) Option

WithUserDataDir sets a directory to use as chrome user profile.

Directories

Path Synopsis
Package patcher provides a patcher for the chromedriver.
Package patcher provides a patcher for the chromedriver.

Jump to

Keyboard shortcuts

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