chrome

package
v0.0.0-...-4272cfe Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTMLTitle

func GetHTMLTitle(r io.Reader) (string, bool)

GetHTMLTitle will parse the Title from an HTML document ref:

https://siongui.github.io/2016/05/10/go-get-html-title-via-net-html/

func GetTechnologies

func GetTechnologies(headers http.Header, body []byte) []string

GetTechnologies uses wapalyzer signatures to return an array of technologies that are in use by the remote site.

func InitWappalyzer

func InitWappalyzer() error

Types

type Chrome

type Chrome struct {
	ResolutionX int
	ResolutionY int
	UserAgent   string
	Timeout     int64
	Delay       int
	FullPage    bool
	ChromePath  string
	Proxy       string
	Headers     []string
	HeadersMap  map[string]interface{}
}

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

func NewChrome

func NewChrome() *Chrome

NewChrome returns a new initialised Chrome struct

func (*Chrome) Preflight

func (chrome *Chrome) Preflight(url *url.URL) (resp *http.Response, title string, technologies []string, err error)

Preflight will preflight a url

func (*Chrome) PrepareHeaderMap

func (chrome *Chrome) PrepareHeaderMap()

initalize the headers Map. we do this given the format chromedp wants Ref:

https://github.com/chromedp/examples/blob/master/headers/main.go

func (*Chrome) Screenshot

func (chrome *Chrome) Screenshot(url *url.URL) ([]byte, error)

Screenshot takes a screenshot of a URL and saves it to destination Ref:

https://github.com/chromedp/examples/blob/255873ca0d76b00e0af8a951a689df3eb4f224c3/screenshot/main.go

func (*Chrome) StorePreflight

func (chrome *Chrome) StorePreflight(url *url.URL, db *gorm.DB, resp *http.Response, title string, technologies []string, filename string) (uint, error)

StorePreflight will store preflight info to a DB

Jump to

Keyboard shortcuts

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