Documentation ¶
Index ¶
- type Element
- func (e Element) FindAll(tag string, recursive bool, limit int, attrs ...string) []Element
- func (e Element) FindNextSibling(tag string, attrs ...string) Element
- func (e Element) FindNextSiblings(tag string, limit int, attrs ...string) []Element
- func (e Element) FindOne(tag string, recursive bool, attrs ...string) Element
- func (e Element) FindParent(tag string, attrs ...string) Element
- func (e Element) FindParents(tag string, limit int, attrs ...string) []Element
- func (e Element) FindPrevSibling(tag string, attrs ...string) Element
- func (e Element) FindPrevSiblings(tag string, limit int, attrs ...string) []Element
- func (e Element) GetText() string
- func (e Element) Parent() Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
func GetRootElement ¶
Takes io.Reader parameter that contains html, parses it and returns first-found element type that is html.ElementNode
func (Element) FindAll ¶
Traverses through children elements of current element and appends to the []Element any child element that satisfies tag and attributes. If recursive == true, than it will look for children elements of children elements, and so on. If limit == -1, then there is no limit. if limit == n, it will return only n-number of elements
func (Element) FindNextSibling ¶
Traverses through sibling elements AFTER current element, and returns element if it satisfies the searching parameters. Otherwise, returns nil
func (Element) FindNextSiblings ¶
Traverses through sibling elements AFTER current element, and returns []Element that contains elements that satisfies the searching parameters. Otherwise, returns nil
func (Element) FindOne ¶
Traverses through children elements of current element and returns first-found child element that satisfies tag and attributes If it doesn't find any element, than it returns nil
func (Element) FindParent ¶
Recursively traverses through parent elements of current element until it finds the element that satisfies tag and attrs
func (Element) FindParents ¶
Recursively traverses through all parent elements of current element and returns []Element that contains elements that satisfies tag and attrs. If limit == -1, then there is no limit. If limit == n, it will return only n-number of elements
func (Element) FindPrevSibling ¶
Traverses through sibling elements BEFORE current element, and returns element if it satisfies the searching parameters. Otherwise, returns nil
func (Element) FindPrevSiblings ¶
Traverses through sibling elements BEFORE current element, and returns []Element that contains elements that satisfies the searching parameters. Otherwise, returns nil