Documentation ¶
Index ¶
- Constants
- Variables
- func AtomLookupString(tagName string) atom.Atom
- func NewTokenizerFile(filename string) (*html.Tokenizer, error)
- func NextStartToken(z *html.Tokenizer, skipErrors bool, htmlAtoms ...atom.Atom) (html.Token, error)
- func NextTextToken(z *html.Tokenizer, skipErrors bool, htmlAtoms ...atom.Atom) (html.Token, error)
- func NextTokenMatch(z *html.Tokenizer, skipErrors, includeChain, includeMatch bool, ...) ([]html.Token, error)
- func ParseLink(tokens ...html.Token) (href string, desc string, err error)
- func TokenAttribute(token html.Token, attrName string) (string, error)
- func TokenMap(t html.Token) map[string]string
- func TokensBetween(z *html.Tokenizer, skipErrors, inclusive bool, begin, end TokenFilters) ([]html.Token, error)
- func TokensBetweenAtom(z *html.Tokenizer, skipErrors, inclusive bool, htmlAtom atom.Atom) ([]html.Token, error)
- func TokensSubset(startFilter, endFilter *TokenFilter, inclusive, greedy bool, toks []html.Token) []html.Token
- type AtomSet
- type Attributes
- type Description
- type DescriptionList
- type DescriptionLists
- type TokenFilter
- type TokenFilters
- type Tokens
Constants ¶
View Source
const (
AttrHref = "href"
)
Variables ¶
View Source
var ErrTokenNotFound = errors.New("token(s) not found")
Functions ¶
func AtomLookupString ¶ added in v0.34.2
func NewTokenizerFile ¶ added in v0.34.2
func NextStartToken ¶
func NextTextToken ¶
func NextTokenMatch ¶
func NextTokenMatch(z *html.Tokenizer, skipErrors, includeChain, includeMatch bool, filters ...TokenFilter) ([]html.Token, error)
NextTokenMatch returns a string of matches. `includeMatch` is only used when `includeChain` is included.
func TokensBetween ¶
func TokensBetweenAtom ¶
func TokensBetweenAtom(z *html.Tokenizer, skipErrors, inclusive bool, htmlAtom atom.Atom) ([]html.Token, error)
TokensBetweenAtom returns the tokens that represent the `innerHtml` between a start and end tag token.
func TokensSubset ¶ added in v0.34.2
Types ¶
type AtomSet ¶
func NewAtomSet ¶
func NewAtomSetString ¶ added in v0.34.2
func NewAtomSetStringMust ¶ added in v0.34.2
type Attributes ¶
type Description ¶ added in v0.34.2
func (*Description) DescriptionString ¶ added in v0.34.2
func (d *Description) DescriptionString() string
func (*Description) Empty ¶ added in v0.34.2
func (d *Description) Empty() bool
func (*Description) Strings ¶ added in v0.34.2
func (d *Description) Strings() []string
func (*Description) TermString ¶ added in v0.34.2
func (d *Description) TermString() string
type DescriptionList ¶ added in v0.34.2
type DescriptionList []Description
func ParseDescriptionListTokens ¶ added in v0.34.2
func ParseDescriptionListTokens(toks ...html.Token) DescriptionList
func TokenizerDescriptionListNext ¶ added in v0.34.2
func TokenizerDescriptionListNext(z *html.Tokenizer) (DescriptionList, error)
func (DescriptionList) Strings ¶ added in v0.34.2
func (dl DescriptionList) Strings() [][]string
type DescriptionLists ¶ added in v0.34.2
type DescriptionLists []DescriptionList
func TokenizerDescriptionLists ¶ added in v0.34.2
func TokenizerDescriptionLists(z *html.Tokenizer) (DescriptionLists, error)
func (DescriptionLists) Strings ¶ added in v0.34.2
func (dls DescriptionLists) Strings() [][][]string
type TokenFilter ¶
find next <tr> or </table>
func NewTokenFilter ¶ added in v0.34.2
func NewTokenFilter(tokenType html.TokenType, atoms ...atom.Atom) *TokenFilter
type TokenFilters ¶
type TokenFilters []TokenFilter
func (TokenFilters) ByTokenType ¶
func (filters TokenFilters) ByTokenType(tt html.TokenType) []TokenFilter
Click to show internal directories.
Click to hide internal directories.