Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultChromeOptions = []ChromeOption{ ChromePort(9515), ChromeURLBase(""), ChromeHTTPThreads(4), ChromeLogPath("./chrome.log"), ChromeStartTimeout(20 * time.Second), }
Functions ¶
func GetDefaultPrefs ¶
func GetDefaultPrefs() map[string]interface{}
Populate a map with default firefox preferences
func NewAPIClient ¶
Types ¶
type Chrome ¶
type Chrome struct { URL *url.URL // Log file to dump chromedriver stdout/stderr. If "" send to terminal. Default: "" LogFile string // contains filtered or unexported fields }
func NewChrome ¶
func NewChrome(path string, options ...ChromeOption) *Chrome
NewChrome returns a new Chrome. It sets the corresponding DefaultChromeOptions option for each option not provided.
type ChromeOption ¶
type ChromeOption func(*Chrome)
func ChromeHTTPThreads ¶
func ChromeHTTPThreads(httpThreads int64) ChromeOption
func ChromeLogPath ¶
func ChromeLogPath(logPath string) ChromeOption
func ChromePort ¶
func ChromePort(port int64) ChromeOption
func ChromeStartTimeout ¶
func ChromeStartTimeout(startTimeout time.Duration) ChromeOption
func ChromeURLBase ¶
func ChromeURLBase(urlBase string) ChromeOption
type FirefoxDriver ¶
type FirefoxDriver struct { URL string // The port firefox webdriver listens on. This port - 1 will be used as a mutex to avoid starting multiple firefox instances listening to the same port. Default: 7055 Port int // Start method fails if lock (see Port) is not acquired before LockPortTimeout. Default 60s LockPortTimeout time.Duration // Start method fails if Firefox doesn't start in less than StartTimeout. Default 20s. StartTimeout time.Duration // Log file to dump firefox stdout/stderr. If "" send to terminal. Default: "" LogFile string // Firefox preferences. Default: see method GetDefaultPrefs Prefs map[string]interface{} // If temporary profile has to be deleted when closing. Default: true DeleteProfileOnClose bool // contains filtered or unexported fields }
func NewFirefoxDriver ¶
func NewFirefoxDriver(firefoxPath string, xpiPath string) *FirefoxDriver
func (*FirefoxDriver) SetLogPath ¶
func (d *FirefoxDriver) SetLogPath(path string)
Equivalent to setting the following firefox preferences to: "webdriver.log.file": path/jsconsole.log "webdriver.log.driver.file": path/driver.log "webdriver.log.profiler.file": path/profiler.log "webdriver.log.browser.file": path/browser.log
func (*FirefoxDriver) Start ¶
func (d *FirefoxDriver) Start() error
func (*FirefoxDriver) Stop ¶
func (d *FirefoxDriver) Stop() error
type InstallRDF ¶
type InstallRDF struct {
Description InstallRDFDescription
}
type InstallRDFDescription ¶
type InstallRDFDescription struct {
Id string `xml:"id"`
}
Click to show internal directories.
Click to hide internal directories.