Documentation ¶
Index ¶
- type A
- func (a *A) Breadth(node *html.Node, filters ...FilterFunc) []*html.Node
- func (a *A) Child(node *html.Node, filters ...FilterFunc) []*html.Node
- func (a *A) Depth(node *html.Node, filters ...FilterFunc) []*html.Node
- func (a *A) NextSibling(root *html.Node, filters ...FilterFunc) []*html.Node
- func (a *A) Parent(node *html.Node, filters ...FilterFunc) []*html.Node
- func (a *A) PrevSibling(node *html.Node, filters ...FilterFunc) []*html.Node
- type F
- func (f *F) Breadth(node *html.Node, filters ...FilterFunc) *html.Node
- func (f *F) Depth(node *html.Node, filters ...FilterFunc) *html.Node
- func (f *F) FirstChild(node *html.Node, filters ...FilterFunc) *html.Node
- func (f *F) FirstSibling(node *html.Node, filters ...FilterFunc) (result *html.Node)
- func (f *F) Index(index int) *F
- func (f *F) LastChild(node *html.Node, filters ...FilterFunc) *html.Node
- func (f *F) LastSibling(node *html.Node, filters ...FilterFunc) (result *html.Node)
- func (f *F) NextSibling(node *html.Node, filters ...FilterFunc) *html.Node
- func (f *F) Parent(root *html.Node, filters ...FilterFunc) *html.Node
- func (f *F) PrevSibling(node *html.Node, filters ...FilterFunc) *html.Node
- type FilterFunc
- func Attr(val string) FilterFunc
- func AttrVal(attr string, val string) FilterFunc
- func ContainsAttr(val string) FilterFunc
- func ContainsTag(val string) FilterFunc
- func ContainsText(val string) FilterFunc
- func ContainsValue(val string) FilterFunc
- func Tag(val string) FilterFunc
- func Text(val string) FilterFunc
- func Value(val string) FilterFunc
- type Scrappy
- func (s *Scrappy) Deep(val int) *Scrappy
- func (s *Scrappy) Get(url string) (*html.Node, error)
- func (s *Scrappy) Nest() *Scrappy
- func (s *Scrappy) Parse(reader io.Reader) (*html.Node, error)
- func (s *Scrappy) Proxy(proxy string) error
- func (s *Scrappy) Validate(node *html.Node, filters ...FilterFunc) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type A ¶
type A struct {
*Scrappy
}
All, group of methods that return all occurrence
func (*A) NextSibling ¶
Next return next sibling nodes that matches with given filters
func (*A) PrevSibling ¶
Prev return prev sibling nodes that matches with given filters
type F ¶
type F struct { *Scrappy // contains filtered or unexported fields }
First, group of methods that return only one occurrence
func (*F) FirstChild ¶
Return first child node that matches
func (*F) FirstSibling ¶
FirstSibling, return first sibling node that matches
func (*F) LastSibling ¶
LastSibling, return last sibling node that matches
func (*F) NextSibling ¶
NextSibling, return next sibling that matches
func (*F) PrevSibling ¶
PrevSibling, return prev sibling that matches
type FilterFunc ¶
FilterFunc is the general definition of a node filter
func Attr ¶
func Attr(val string) FilterFunc
Attr is a filter func that return a node that matches with a given string
func AttrVal ¶
func AttrVal(attr string, val string) FilterFunc
AttrVal is a filter func that return a node that matches with a pair attr/value
func ContainsAttr ¶
func ContainsAttr(val string) FilterFunc
ContainAttr is a filter func that return a node with an attr that contain a given string
func ContainsTag ¶
func ContainsTag(val string) FilterFunc
ContainTag is a filter func that return a node with a tag that contain a given string
func ContainsText ¶
func ContainsText(val string) FilterFunc
ContainText is a filter func that return a node that contain a given string
func ContainsValue ¶
func ContainsValue(val string) FilterFunc
AttrValues is a filter func that return a node with an attr value that contain a given string
func Tag ¶
func Tag(val string) FilterFunc
Tag s a filter func that return a node that matches with a given string
func Text ¶
func Text(val string) FilterFunc
Text is a filter func that return a node that matches with a given string
func Value ¶
func Value(val string) FilterFunc
Values is a filter func that return a node that matches with a given string
type Scrappy ¶
Scrappy is the cool struct of the lib