scraper

package
v0.12.8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(uri *url.URL, doc *goquery.Document, depth, item, total int) error

type Config

type Config struct {
	Concurrency int
	MaxDepth    int
	Callback    Callback
	Client      *http.Client
}

type Error

type Error struct {
	URI string
	Err error
}

func (*Error) String

func (e *Error) String() string

type Errors

type Errors []*Error

func (Errors) Error

func (e Errors) Error() error

type Scraper

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

func New

func New(c Config) *Scraper

func (*Scraper) Scrape

func (s *Scraper) Scrape(uri string, cb Callback) Errors

func (*Scraper) ScrapeWithContext

func (s *Scraper) ScrapeWithContext(ctx context.Context, uri string, cb Callback) Errors

Jump to

Keyboard shortcuts

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