scraper

package module
v0.0.0-...-2f0050d Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	URL       string
	Selectors []*Selector
}

Page ...

type ScrapResult

type ScrapResult struct {
	Text     string
	LinkURL  string
	ImageURL string
}

ScrapResult ...

type Scraper

type Scraper struct {
	ID      string
	BaseURL string
	Pages   []*Page
}

Scraper represents default scraper

func InitScraper

func InitScraper(c crawler.Crawler, s []Selector) *Scraper

InitScraper creates a Scraper with selectors attached to it

func (*Scraper) Scrap

func (s *Scraper) Scrap() error

type Selector

type Selector struct {
	Name        string `json:"Name"`
	ScrapText   bool   `json:"ScrapText"`
	ScrapLinks  bool   `json:"ScrapLinks"`
	ScrapImages bool   `json:"ScrapImages"`
	ScrapResult
}

Selector ...

func NewSelector

func NewSelector(name string, scrapPageImages bool, scrapPageLinks bool, scrapPageText bool) Selector

Jump to

Keyboard shortcuts

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