htmlx

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: BSD-3-Clause Imports: 5 Imported by: 1

README

htmlx

Build Status Coverage Status Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttrVal

func AttrVal(attr []html.Attribute, key string) (val string, ok bool)

func HasAttr added in v0.2.0

func HasAttr(attr []html.Attribute, key string) (ok bool)

func HasAttrVal

func HasAttrVal(attr []html.Attribute, key, val string) bool

func HasAttrWord

func HasAttrWord(attr []html.Attribute, key, word string) bool

Types

type Finder

type Finder struct {
	*html.Node
}

func FinderFromData

func FinderFromData(r io.Reader) (f Finder, err error)

func FinderFromNode

func FinderFromNode(h *html.Node) Finder

func FinderFromString

func FinderFromString(s string) (Finder, error)

func (Finder) AttrVal added in v0.2.0

func (f Finder) AttrVal(key string) (val string, ok bool)

func (Finder) ClassList added in v0.2.0

func (f Finder) ClassList() (classes []string, ok bool)

func (Finder) Find

func (f Finder) Find(pred FinderPredicate) (r Finder)

Find is universal finder. Includes current node in search.

func (Finder) FindByAttr

func (f Finder) FindByAttr(attr, val string) Finder

func (Finder) FindByClass

func (f Finder) FindByClass(class string) Finder

func (Finder) FindById

func (f Finder) FindById(id string) Finder

func (Finder) FindElement

func (f Finder) FindElement(element atom.Atom) Finder

func (Finder) FindSibling

func (f Finder) FindSibling(pred FinderPredicate) (r Finder)

FindSibling performs flat find among node's siblings. No recursion. Omits current node, starts from a first sibling.

func (Finder) FindSiblingByAttr

func (f Finder) FindSiblingByAttr(attr, val string) Finder

func (Finder) FindSiblingByClass

func (f Finder) FindSiblingByClass(class string) Finder

func (Finder) FindSiblingById

func (f Finder) FindSiblingById(id string) Finder

func (Finder) FindSiblingElement

func (f Finder) FindSiblingElement(element atom.Atom) Finder

func (Finder) FirstChild

func (f Finder) FirstChild() Finder

func (Finder) HasAttr added in v0.2.0

func (f Finder) HasAttr(key string) bool

func (Finder) HasAttrVal added in v0.2.0

func (f Finder) HasAttrVal(key, val string) bool

func (Finder) HasAttrWord added in v0.2.0

func (f Finder) HasAttrWord(key, word string) bool

func (Finder) HasClass added in v0.2.0

func (f Finder) HasClass(class string) bool

func (Finder) HasId added in v0.2.0

func (f Finder) HasId(id string) bool

func (Finder) Id added in v0.2.0

func (f Finder) Id() (id string, ok bool)

func (Finder) IsEmpty

func (f Finder) IsEmpty() bool

func (Finder) NextSibling

func (f Finder) NextSibling() Finder

func (Finder) String

func (f Finder) String() string

type FinderPredicate

type FinderPredicate func(*html.Node) bool

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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