scrapemateapp

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 17 Imported by: 15

Documentation

Index

Constants

View Source
const (
	DefaultConcurrency = 1
	DefaultProvider    = "memory"
)

Variables

This section is empty.

Functions

func DisableImages added in v0.6.0

func DisableImages() func(*jsOptions)

func Headfull added in v0.2.2

func Headfull() func(*jsOptions)

func WithBrowserEngine added in v1.0.0

func WithBrowserEngine(_ string) func(*jsOptions)

func WithBrowserPoolSize added in v1.2.0

func WithBrowserPoolSize(size int) func(*Config) error

func WithBrowserReuseLimit added in v0.9.0

func WithBrowserReuseLimit(limit int) func(*Config) error

func WithCache

func WithCache(cacheType, cachePath string) func(*Config) error

func WithConcurrency

func WithConcurrency(concurrency int) func(*Config) error

func WithExitOnInactivity added in v0.5.0

func WithExitOnInactivity(duration time.Duration) func(*Config) error

func WithInitJob added in v0.4.3

func WithInitJob(job scrapemate.IJob) func(*Config) error

func WithJS

func WithJS(opts ...func(*jsOptions)) func(*Config) error

func WithMaxPagesPerBrowser added in v1.2.0

func WithMaxPagesPerBrowser(limit int) func(*Config) error

func WithPageReuseLimit added in v0.9.0

func WithPageReuseLimit(limit int) func(*Config) error

func WithProvider

func WithProvider(provider scrapemate.JobProvider) func(*Config) error

func WithProxies added in v0.7.0

func WithProxies(proxies []string) func(*Config) error

func WithRodStealth added in v1.0.0

func WithRodStealth() func(*jsOptions)

func WithStealth added in v0.8.3

func WithStealth(browser string) func(*Config) error

func WithUA added in v0.9.1

func WithUA(ua string) func(*jsOptions)

Types

type Config added in v0.3.0

type Config struct {
	Concurrency        int `validate:"required,gte=1"`
	BrowserPoolSize    int `validate:"omitempty,gte=0"`
	MaxPagesPerBrowser int `validate:"required,gte=1"`

	CacheType string `validate:"omitempty,oneof=file leveldb"`
	CachePath string `validate:"required_with=CacheType"`

	UseJS          bool   `validate:"omitempty"`
	UseStealth     bool   `validate:"omitempty"`
	StealthBrowser string `validate:"omitempty"`
	JSOpts         jsOptions

	Provider scrapemate.JobProvider

	Writers                  []scrapemate.ResultWriter `validate:"required,gt=0"`
	InitJob                  scrapemate.IJob
	ExitOnInactivityDuration time.Duration
	Proxies                  []string
	BrowserReuseLimit        int
	PageReuseLimit           int
}

func NewConfig

func NewConfig(writers []scrapemate.ResultWriter, options ...func(*Config) error) (*Config, error)

type ScrapemateApp

type ScrapemateApp struct {
	// contains filtered or unexported fields
}

func NewScrapeMateApp

func NewScrapeMateApp(cfg *Config) (*ScrapemateApp, error)

NewScrapemateApp creates a new ScrapemateApp.

func (*ScrapemateApp) Close

func (app *ScrapemateApp) Close() error

Close closes the app.

func (*ScrapemateApp) Start

func (app *ScrapemateApp) Start(ctx context.Context, seedJobs ...scrapemate.IJob) error

Start starts the app.

Jump to

Keyboard shortcuts

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