fetcher

package
v0.0.0-...-6ef7139 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUserDataDir default user data dir for non-headless mode
	DefaultUserDataDir = "/tmp/chrome_dev_1"

	// DefaultInterval default time to wait (in seconds) when watching a selector
	DefaultInterval = 30

	// DefaultRedisWriteTimeout default timeout (seconds) for writing to redis
	DefaultRedisWriteTimeout = 10

	// DefaultSubject to send email with
	DefaultSubject = "Go-Scraper Watcher"

	// DefaultCaptchaWaitSelector default to wait for captcha box on block
	DefaultCaptchaWaitSelector = `div.re-captcha`

	// DefaultCaptchaClickSelector default to click once captcha box appears
	DefaultCaptchaClickSelector = `div.g-recaptcha`

	// DefaultCaptchaIframeWaitSelector default wait selector for captcha iframe
	DefaultCaptchaIframeWaitSelector = `body > div:nth-child(6) > div:nth-child(4) > iframe`

	// DefaultCaptchaClickSleep default time (seconds) we sleep after a captcha click, to allow the captcha challenge to get loaded into the iframe
	DefaultCaptchaClickSleep = 5
)

Variables

View Source
var (
	// DefaultUserAgents The default user agents to send requests as
	DefaultUserAgents = []string{
		`Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36`,
	}
)

Functions

func CommonRootChecks

func CommonRootChecks(cmd *cobra.Command) error

CommonRootChecks does checks for flags for root commands

func CommonWatchChecks

func CommonWatchChecks(cmd *cobra.Command) error

CommonWatchChecks checks if the common required flags for watch command are present - sub-commands check their own specific flags separately

func EmailContent

func EmailContent(cmd *cobra.Command)

EmailContent will watch content and take action if content is available

func Log

func Log() *logger.Logger

Log creates a logger that we can use in the app

func PrintContent

func PrintContent(cmd *cobra.Command)

PrintContent fetches HTML content

Types

This section is empty.

Jump to

Keyboard shortcuts

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