oxywd

package module
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 12 Imported by: 0

README

0xyWD

Proxied webdriver session util package written in GoLang

Supported capabilities

  • Google Chrome
  • Firefox

Include in project

import oxywd "github.com/sik0-o/0xyWD"

Usage

var proxyURL string

...

chromeCaps := chrome.Capabilities{}

if err := oxywd.SetProxy(&chromeCaps, proxyURL); err != nil {
  return nil, err
}

caps := selenium.Capabilities{}
caps.AddChrome(chromeCaps)

// init selenium session with capabilities

Basic API

SetProxy(CapsExtAdder, string) error

Build and add proxy extension with provded proxyURL string in browser capabilities that have CapsExtAdder interface.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExtension

func AddExtension(caps CapsExtensionAdder, path string) error

func AddUnpackedExtension

func AddUnpackedExtension(caps CapsUnpackedExtensionAdder, basePath string) error

func Md5Str

func Md5Str(hashing string) string

func SetProxy

func SetProxy(caps CapsExtAdder, proxy string) error

SetProxy build a proxy unpacked extension for browser and than inject it in browser capabilities. It also creates temporary folder `tmp`. in this version of method empty proxy do not fires an error.

func SetProxyZip added in v0.2.7

func SetProxyZip(caps CapsExtAdder, proxy string) error

SetProxyZip build a proxy ZIP extension for browser and than inject it in browser capabilities. It also creates temporary folder `tmp`. in this version of method empty proxy do not fires an error.

func СreateZipFromFolder added in v0.2.7

func СreateZipFromFolder(location string, zipfilename string) error

СreateZipFromFolder создает zip архив zipfilename из директории location и в случае ошибки возвращает error.

Types

type CapsExtAdder

type CapsExtAdder interface {
	CapsExtensionAdder
	CapsUnpackedExtensionAdder
}

type CapsExtensionAdder

type CapsExtensionAdder interface {
	AddExtension(path string) error
}

type CapsUnpackedExtensionAdder

type CapsUnpackedExtensionAdder interface {
	AddUnpackedExtension(basePath string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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