webscraper

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerTag = "SCRAPER"

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	Text  string
	Index int
}

type Scraper

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

func NewScraper

func NewScraper() *Scraper

func (*Scraper) FetchAndScrape

func (o *Scraper) FetchAndScrape(ctx context.Context, url, queryPath string, handler func(e Element)) error

func (*Scraper) Scrape

func (o *Scraper) Scrape(queryPath string, handler func(e Element)) error

func (*Scraper) WithLogger

func (o *Scraper) WithLogger(l log.Logger) *Scraper

To be useful WithLogger should come ahead of With...() functions

func (*Scraper) WithPreloadedDoc

func (o *Scraper) WithPreloadedDoc(ctx context.Context, url string) (*Scraper, error)

func (*Scraper) WithPreloadedDocFromBytes

func (o *Scraper) WithPreloadedDocFromBytes(b []byte) (*Scraper, error)

Jump to

Keyboard shortcuts

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