chromedpcv

package module
v0.0.0-...-de293d4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

README

chromepdcv

... allows you to find elements in a website or regions rendered within a canvas and click them. You can also just get the position or the node(s) at that position.

alt text

Install
brew install opencv

opencv: stable 4.0.1 (bottled) Open source computer vision library https://opencv.org/ /usr/local/Cellar/opencv/4.0.1 (679 files, 226MB) * Poured from bottle on 2019-01-24 at 22:34:46

go get -u github.com/rand99/chromedpcv
Try yourself
cd example
./download_chromium
go build . && ./example
Documentation

godoc

Known issues

chrome headless doesn't work, must be a chromedp thing

2019/02/10 19:33:51 timeout waiting for initial target

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserWindow

type BrowserWindow struct {
	Width  int64
	Height int64
}

type BrowserWindowPosition

type BrowserWindowPosition struct {
	X int64
	Y int64
	// contains filtered or unexported fields
}

type ChromeDpCV

type ChromeDpCV struct {
	// TemplateMatchMarkedScreenShotFilePath allows to to keep an image of the screenshot where the searched region is marked, this helps with debugging
	TemplateMatchMarkedScreenShotFilePath string
	TemplateMatchMode                     gocv.TemplateMatchMode
	IMReadFlag                            gocv.IMReadFlag
	// Debug show errors messages with stack
	Debug bool
}

ChromeDpCV

func New

func New() *ChromeDpCV

func (*ChromeDpCV) MouseClickAtPosition

func (c *ChromeDpCV) MouseClickAtPosition(position *BrowserWindowPosition, opts ...chromedp.MouseOption) chromedp.Action

func (*ChromeDpCV) MouseClickWhereScreenLooksLike

func (c *ChromeDpCV) MouseClickWhereScreenLooksLike(targetImagePath string, opts ...chromedp.MouseOption) chromedp.Action

func (*ChromeDpCV) NodesAtPosition

func (c *ChromeDpCV) NodesAtPosition(position *BrowserWindowPosition, resultNodes *[]*cdp.Node) chromedp.Action

func (*ChromeDpCV) NodesWhereScreenLooksLike

func (c *ChromeDpCV) NodesWhereScreenLooksLike(targetImagePath string, resultNodes *[]*cdp.Node) chromedp.Action

func (*ChromeDpCV) PositionWhereScreenLooksLike

func (c *ChromeDpCV) PositionWhereScreenLooksLike(targetImagePath string, position *BrowserWindowPosition) chromedp.Action

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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