selector

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClassField selectorField = iota
	IDField
	NameField
	AttrField
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicSelector

type BasicSelector struct {
	Name  *regexp.Regexp
	Attrs map[string]*regexp.Regexp
}

A CSS Selector

func (BasicSelector) FindAll

func (sel BasicSelector) FindAll(node *html.Node) []*html.Node

Find all nodes which match a selector. May return itself.

func (BasicSelector) FindAllChildren

func (sel BasicSelector) FindAllChildren(node *html.Node) []*html.Node

Find all nodes which match a selector.

func (BasicSelector) Match

func (sel BasicSelector) Match(node *html.Node) bool

Does this selector match a given node?

func (BasicSelector) Select

func (sel BasicSelector) Select(nodes []*html.Node) []*html.Node

type Selector

type Selector interface {
	Select(nodes []*html.Node) []*html.Node
}

func NewSelector

func NewSelector(s string) (Selector, error)

Convert a string to a selector.

type SliceSelector

type SliceSelector struct {
	Start      int
	LimitStart bool
	End        int
	LimitEnd   bool
	By         int
	N          int
}

func (SliceSelector) Select

func (sel SliceSelector) Select(nodes []*html.Node) []*html.Node

Jump to

Keyboard shortcuts

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