query

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEngineNotFound    = errors.New("engine not found")
	ErrCouldNotFindElem  = errors.New("could not find element in content by selector")
	ErrTimeLayoutIsEmpty = errors.New("time layout props is empty")
)

Functions

This section is empty.

Types

type Document

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

func NewDocument

func NewDocument(engine Engine, root *html.Node) (*Document, error)

func (*Document) Find

func (d *Document) Find(selector Selector) ([]string, error)

func (*Document) FindOne

func (d *Document) FindOne(selector Selector) (string, error)

func (*Document) FindTime

func (d *Document) FindTime(timeSelector SelectorTime) (time.Time, error)

type Engine

type Engine string
const (
	GoQuery Engine = "goquery"
	XPath   Engine = "xpath"
)

type Selector

type Selector struct {
	Expr string
	Attr string
}

type SelectorTime

type SelectorTime struct {
	Selector
	Layout string
}

Jump to

Keyboard shortcuts

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