html

package module
v0.0.0-...-5f6c96f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2014 License: MIT Imports: 7 Imported by: 0

README

Simplified HTML parsing

This package simplifies golang.org/x/net/html.

http://godoc.org/gopkg.in/felixrabe-go/html.v0

import "gopkg.in/felixrabe-go/html.v0"

License

The MIT License (MIT)

Copyright (c) 2014 Felix Rabe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node html.Node

func Parse

func Parse(r io.Reader) (*Node, error)

func ParseBytes

func ParseBytes(b []byte) (*Node, error)

func ParseString

func ParseString(s string) (*Node, error)

func ParseUrl

func ParseUrl(url string) (*Node, error)

func (*Node) AppendChild

func (node *Node) AppendChild(child *Node)

func (*Node) Children

func (node *Node) Children() (children []*Node)

Children returns all child nodes.

func (*Node) ElementChildren

func (node *Node) ElementChildren() (children []*Node)

ElementChildren returns all child nodes that are elements.

func (*Node) FindByAtom

func (node *Node) FindByAtom(atoms ...atom.Atom) (nodes []*Node)

FindByAtom finds element nodes by their atom across multiple levels.

func (*Node) GetAllText

func (node *Node) GetAllText() string

GetAllText gets all text without any tags.

func (*Node) GetAttr

func (node *Node) GetAttr(key string) string

func (*Node) Next

func (node *Node) Next() *Node

func (*Node) NextByAtom

func (node *Node) NextByAtom(atom atom.Atom) *Node

NextByAtom finds the next sibling element by its atom.

func (*Node) NextElement

func (node *Node) NextElement() *Node

func (*Node) Prev

func (node *Node) Prev() *Node

func (*Node) PrevByAtom

func (node *Node) PrevByAtom(atom atom.Atom) *Node

PrevByAtom finds the previous sibling element by its atom.

func (*Node) PrevElement

func (node *Node) PrevElement() *Node

func (*Node) RawString

func (node *Node) RawString() string

func (*Node) RemoveAttr

func (node *Node) RemoveAttr(key string)

func (*Node) RemoveChild

func (node *Node) RemoveChild(child *Node)

func (*Node) String

func (node *Node) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL