Documentation ¶
Index ¶
- Variables
- type DOM
- func (id *DOM) ChildFind(parent *DOMNode, tag string, attributes DOMNodeAttributes) (result []*DOMNode)
- func (id *DOM) ChildFindJSONForScriptWithKeyDelimiter(parent *DOMNode, substring string, delimiter JSONDelimiter) (result JSONMap, err error)
- func (id *DOM) ChildFindTextForClass(parent *DOMNode, tag string, class string) (result string)
- func (id *DOM) ChildFindWithKey(parent *DOMNode, tag string, substring string) (result []*DOMNode)
- func (id *DOM) ContentLength() int
- func (id *DOM) Contents() string
- func (id *DOM) Dump()
- func (id *DOM) Find(tag string, attributes DOMNodeAttributes) (result []*DOMNode)
- func (id *DOM) FindJSONForScriptWithKey(substring string) (result JSONMap, err error)
- func (id *DOM) FindJSONForScriptWithKeyDelimiter(substring string, delimiter JSONDelimiter) (result JSONMap, err error)
- func (id *DOM) FindTextForClass(tag string, class string) (result string)
- func (id *DOM) FindWithKey(tag string, substring string) (result []*DOMNode)
- func (id *DOM) IsChildNode(parent *DOMNode, node *DOMNode) (result bool)
- func (id *DOM) IsDescendantNode(parent *DOMNode, node *DOMNode) (result bool)
- func (id *DOM) RootNode() (result *DOMNode)
- func (id *DOM) SetContents(htmlString string)
- func (id *DOM) String() (result string)
- type DOMNode
- type DOMNodeAttributes
- type JSONDelimiter
- type JSONMap
Constants ¶
This section is empty.
Variables ¶
var JSONArrayDelimiter = JSONDelimiter{"[", "]"}
JSONArrayDelimiter type
var JSONDictionaryDelimiter = JSONDelimiter{"{", "}"}
JSONDictionaryDelimiter type
Functions ¶
This section is empty.
Types ¶
type DOM ¶
type DOM struct {
// contains filtered or unexported fields
}
DOM Document.
func (*DOM) ChildFind ¶
func (id *DOM) ChildFind(parent *DOMNode, tag string, attributes DOMNodeAttributes) (result []*DOMNode)
ChildFind : Find the child Node of type tag with the specified attributes
func (*DOM) ChildFindJSONForScriptWithKeyDelimiter ¶
func (id *DOM) ChildFindJSONForScriptWithKeyDelimiter(parent *DOMNode, substring string, delimiter JSONDelimiter) (result JSONMap, err error)
ChildFindJSONForScriptWithKeyDelimiter : Find the child JSON key with delimited text containing substring
func (*DOM) ChildFindTextForClass ¶
ChildFindTextForClass : Find the child given tag with the specified attributes
func (*DOM) ChildFindWithKey ¶
ChildFindWithKey : Find the child Node of type tag with text containing key
func (*DOM) ContentLength ¶
ContentLength : The byte count of the raw html contents.
func (*DOM) Find ¶
func (id *DOM) Find(tag string, attributes DOMNodeAttributes) (result []*DOMNode)
Find : Find the Node of type tag with the specified attributes
func (*DOM) FindJSONForScriptWithKey ¶
FindJSONForScriptWithKey : Find the JSON key with text containing substring
func (*DOM) FindJSONForScriptWithKeyDelimiter ¶
func (id *DOM) FindJSONForScriptWithKeyDelimiter(substring string, delimiter JSONDelimiter) (result JSONMap, err error)
FindJSONForScriptWithKeyDelimiter : Find the JSON key with delimited text containing substring
func (*DOM) FindTextForClass ¶
FindTextForClass : Find the given tag with the specified attributes
func (*DOM) FindWithKey ¶
FindWithKey : Find the Node of type tag with text containing key
func (*DOM) IsChildNode ¶
IsChildNode : Is node a child of parent? The fastest confirmation is bottom up since the relationships are one to many.
func (*DOM) IsDescendantNode ¶
IsDescendantNode : Is node a descendant of parent? The fastest confirmation is bottom up since the relationships are one to many.
func (*DOM) SetContents ¶
SetContents : parse the raw html contents.
type DOMNode ¶
type DOMNode struct { Index int Tag string Attributes DOMNodeAttributes TextFragments []string Parent *DOMNode Children []*DOMNode }
DOMNode def
func NewDOMNode ¶
func NewDOMNode(index int, parent *DOMNode, tag string, attributes DOMNodeAttributes) DOMNode
NewDOMNode constructor
func (*DOMNode) ReaderText ¶
ReaderText recombines the node text fragments into the human reader visibile text
type DOMNodeAttributes ¶
DOMNodeAttributes map of strings keyed by strings