Documentation ¶
Index ¶
- Variables
- type Parser
- func (p *Parser) Body() (*html.Node, error)
- func (p *Parser) FirstChild() (*html.Node, error)
- func (p *Parser) FirstElementByAtom(a atom.Atom) (*html.Node, error)
- func (p *Parser) FirstMeta() (*html.Node, error)
- func (p *Parser) Head() (*html.Node, error)
- func (p *Parser) LastChild() (*html.Node, error)
- func (p *Parser) Level() int
- func (p *Parser) Next() (*html.Node, error)
- func (p *Parser) NextElement() (*html.Node, error)
- func (p *Parser) NextElementByAtom(a atom.Atom) (*html.Node, error)
- func (p *Parser) NextMeta() (*html.Node, error)
- func (p *Parser) NextSibling() (*html.Node, error)
- func (p *Parser) Node() *html.Node
- func (p *Parser) Parent() (*html.Node, error)
- func (p *Parser) Prev() (*html.Node, error)
- func (p *Parser) PrevElement() (*html.Node, error)
- func (p *Parser) PrevSibling() (*html.Node, error)
- func (p *Parser) Reset() *html.Node
Constants ¶
This section is empty.
Variables ¶
var ( ErrBegOfDoc = errors.New("reached beginning of document") ErrEndOfDoc = errors.New("reached end of document") ErrNoSuchRelative = errors.New("node does not have requested rel") )
Parser errors
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a HTML parser.
func (*Parser) FirstChild ¶
FirstChild advances the parser to the first child if it exists.
func (*Parser) FirstElementByAtom ¶
FirstElementByAtom advances the parser to the first element in a document with the given atom.
func (*Parser) Level ¶
Level returns the current level of the html parser
The <html> tag is fixed to level 1, and nested tags are one level higher than their parent.
func (*Parser) NextElement ¶
NextElement advances the parser to the next element node if it exists.
func (*Parser) NextElementByAtom ¶
NextElementByAtom advances to the next element with the given atom.
func (*Parser) NextSibling ¶
NextSibling advances the parser to the next sibling if it exists.
func (*Parser) PrevElement ¶
PrevElement retreats the parser to the previous element node if it exists.
func (*Parser) PrevSibling ¶
PrevSibling retreats the parser to the previous sibling if it exists.