Documentation
¶
Index ¶
- type Attributes
- type Element
- func (element *Element) Find(tagName string, attributes Attributes) *Element
- func (element *Element) FindAll(tagName string, attributes Attributes) []*Element
- func (element *Element) FindAllByAttributes(attributes Attributes) []*Element
- func (element *Element) FindAllByTag(tagName string) []*Element
- func (element *Element) FindByAttributes(attributes Attributes) *Element
- func (element *Element) FindByTag(tagName string) *Element
- func (element *Element) GetAttribute(attributeName string) (string, bool)
- func (element *Element) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
Attributes is a map[string]string that represents the attributes of an element it is used to call the Find and derivative methods conveniently as in the BeautifulSoup in example: Find("div", Attributes{"class":"exampleClass", "name":"exampleName"})
type Element ¶
Element is the root node returned from the api methods, it contains a pointer to the html.Node the underlying *html.Node could be accessed as element.Node
func ParseAsHTML ¶
ParseAsHTML function parses the given string as html Returns an Element pointer to the root node and error if any error occurs
func (*Element) Find ¶
func (element *Element) Find(tagName string, attributes Attributes) *Element
Find method returns the first occurrence of the node with the given tagName and attributes returns nil if not found any node with the given parameters
func (*Element) FindAll ¶
func (element *Element) FindAll(tagName string, attributes Attributes) []*Element
FindAll method returns all nodes with the given tagName and attributes
func (*Element) FindAllByAttributes ¶
func (element *Element) FindAllByAttributes(attributes Attributes) []*Element
FindAllByAttributes method returns all nodes with the given attributes
func (*Element) FindAllByTag ¶
FindAllByTag method returns all nodes with the given tagName
func (*Element) FindByAttributes ¶
func (element *Element) FindByAttributes(attributes Attributes) *Element
FindByAttributes methods returns the first occurrence of the node with the given attributes
func (*Element) FindByTag ¶
FindByTag method returns the first occurrence of the node with the given tagName, returns nil if not found
func (*Element) GetAttribute ¶
GetAttribute method behaves like a map lookup, returns the value of the attribute with the given key and true if found, returns "" and false if not found