parse

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNotExpectValueError

func NewNotExpectValueError(got interface{}) error

Types

type Document

type Document struct {
	Selection *goquery.Selection
}

func Dom

func Dom(b []byte) (dom *Document, err error)

func NewDocumentFromBytes

func NewDocumentFromBytes(b []byte) (dom *Document, err error)

func (*Document) Attr

func (dom *Document) Attr(attrName string) (string, error)

func (*Document) Each

func (dom *Document) Each(fn DomEachFunc) error

Each 返回最后一次错误

func (*Document) EachWithBreak

func (dom *Document) EachWithBreak(fn DomEachFunc) error

func (*Document) Eq

func (dom *Document) Eq(index int) *Document

func (*Document) Find

func (dom *Document) Find(selector string) *Document

func (*Document) InnerHTML

func (dom *Document) InnerHTML() (innerHTML string, err error)

func (*Document) InnerHTMLWithoutError

func (dom *Document) InnerHTMLWithoutError() string

func (*Document) InnerText

func (dom *Document) InnerText() string

func (*Document) Length

func (dom *Document) Length() int

func (*Document) MustFind

func (dom *Document) MustFind(selector string) (*Document, error)

func (*Document) OuterHtml

func (dom *Document) OuterHtml() (outerHtml string, err error)

func (*Document) Text

func (dom *Document) Text() string

func (*Document) TrimSpaceInnerText

func (dom *Document) TrimSpaceInnerText() string

func (*Document) TrimSpaceText

func (dom *Document) TrimSpaceText() string

type DocumentError

type DocumentError struct {
	errors.LocatorError
}

type DomEachFunc

type DomEachFunc func(i int, dom *Document) error

type JsonUnmarshalError

type JsonUnmarshalError struct {
	errors.Err
}

type NotExpectValueError

type NotExpectValueError struct {
	errors.Err
}

type Parser

type Parser struct {
	Json   *_json
	Regexp *_regexp

	Dom *Document
	// contains filtered or unexported fields
}

func Parse

func Parse(b []byte, mode ParserMode) (*Parser, error)

func (*Parser) DebugStoreTestDir

func (receiver *Parser) DebugStoreTestDir()

type ParserMode

type ParserMode uint8
const (
	ModeEnableJson ParserMode = 1 << iota
	ModeEnableDom
	ModeEnableRegexp
)

type RegexpNotMatchError

type RegexpNotMatchError struct {
	errors.Err
}

type RegexpWrapper

type RegexpWrapper struct {
	// contains filtered or unexported fields
}

func Regexp

func Regexp(regexp *regexp.Regexp) *RegexpWrapper

func (*RegexpWrapper) FindAllStringSubMatch

func (receiver *RegexpWrapper) FindAllStringSubMatch(s string, n int) ([][]string, error)

func (*RegexpWrapper) FindStringSubMatch

func (receiver *RegexpWrapper) FindStringSubMatch(s string) ([]string, error)

func (*RegexpWrapper) FindSubMatch

func (receiver *RegexpWrapper) FindSubMatch(b []byte) ([][]byte, error)

Jump to

Keyboard shortcuts

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