Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTMLDocument ¶
type HTMLDocument struct {
// contains filtered or unexported fields
}
HTMLDocument represents a collection of nodes under a single parent container.
func (*HTMLDocument) Filter ¶
func (h *HTMLDocument) Filter(sel string) (parser.Document, error)
Filter traverses the document tree and attempts to match elements against the provided CSS selector. On success, a new document is returned, containing a list of all matched elements. An error is returned if the CSS selector is malformed, or no elements were matched.
func (*HTMLDocument) Slice ¶
func (h *HTMLDocument) Slice() []parser.Document
Slice decomposes the target HTMLDocument into a slice of HTMLDocument types, each containing a single node from the parent's list of nodes.
func (*HTMLDocument) String ¶
func (h *HTMLDocument) String() string
Returns the document contents by traversing the tree and concatenating all data contained within text nodes.
type HTMLParser ¶
type HTMLParser struct{}
HTMLParser represents a parser and tokeniser for HTML documents.