Documentation
¶
Index ¶
- func Get(root *html.Node, selectors []string) ([]*html.Node, error)
- func ParseAttrMatcher(selector *CSSselector, s scanner.Scanner) error
- func ParseClassMatcher(selector *CSSselector, s scanner.Scanner) error
- func ParseHTML(r io.Reader, cs string) (*html.Node, error)
- func ParseIdMatcher(selector *CSSselector, s scanner.Scanner) error
- func ParsePseudo(selector *CSSselector, s scanner.Scanner) error
- func ParseTagMatcher(selector *CSSselector, s scanner.Scanner) error
- func Select(s selector) selectorFunc
- func SelectFromChildren(s selector) selectorFunc
- func SelectNextSibling(s selector) selectorFunc
- type CSSselector
- type PseudoClass
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAttrMatcher ¶
func ParseAttrMatcher(selector *CSSselector, s scanner.Scanner) error
Parse an attribute matcher e.g. `[attr^="http"]`
func ParseClassMatcher ¶
func ParseClassMatcher(selector *CSSselector, s scanner.Scanner) error
Parse a class matcher e.g. `.btn`
func ParseIdMatcher ¶
func ParseIdMatcher(selector *CSSselector, s scanner.Scanner) error
Parse an id matcher e.g. `#my-picture`
func ParsePseudo ¶
func ParsePseudo(selector *CSSselector, s scanner.Scanner) error
Parse the selector after ':'
func ParseTagMatcher ¶
func ParseTagMatcher(selector *CSSselector, s scanner.Scanner) error
Parse the initial tag e.g. `div`
func SelectFromChildren ¶
func SelectFromChildren(s selector) selectorFunc
SelectFromChildren selects the children of the nodes Defined for the '+' selector
func SelectNextSibling ¶
func SelectNextSibling(s selector) selectorFunc
SelectNextSibling selects the next sibling of the node Defined for the '>' selector
Types ¶
type CSSselector ¶
type CSSselector struct { Tag string Attrs map[string]*regexp.Regexp Pseudo PseudoClass }
func ParseSelector ¶
func ParseSelector(cmd string) (selector CSSselector, err error)
ParseSelector parses a selector e.g. `div#my-button.btn[href^="http"]`
type PseudoClass ¶
Click to show internal directories.
Click to hide internal directories.