fetch

package
v0.5.38 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GQDocument

func GQDocument(f Fetcher, urlStr string, opts *FetchOpts) (*goquery.Document, error)

func MakeURLStringSlug

func MakeURLStringSlug(u string) string

func TrimURLScheme

func TrimURLScheme(u string) string

Types

type DynamicFetcher

type DynamicFetcher struct {
	UserAgent        string
	WaitMilliseconds int
	// contains filtered or unexported fields
}

The DynamicFetcher renders js

func NewDynamicFetcher

func NewDynamicFetcher(ua string, ms int) *DynamicFetcher

func (*DynamicFetcher) Cancel

func (d *DynamicFetcher) Cancel()

func (*DynamicFetcher) Fetch

func (d *DynamicFetcher) Fetch(urlStr string, opts *FetchOpts) (string, error)

type FetchOpts

type FetchOpts struct {
	Interaction []*types.Interaction
}

type Fetcher

type Fetcher interface {
	Fetch(url string, opts *FetchOpts) (string, error)
}

A Fetcher allows to fetch the content of a web page

type FileFetcher

type FileFetcher struct {
}

The FileFetcher fetches static page content

func (*FileFetcher) Fetch

func (s *FileFetcher) Fetch(url string, opts *FetchOpts) (string, error)

type StaticFetcher

type StaticFetcher struct {
	UserAgent string
}

The StaticFetcher fetches static page content

func (*StaticFetcher) Fetch

func (s *StaticFetcher) Fetch(url string, opts *FetchOpts) (string, error)

Jump to

Keyboard shortcuts

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