utils

package
v0.0.0-...-b34fe98 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const UserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"

Variables

This section is empty.

Functions

func DecodeHTMLBody

func DecodeHTMLBody(body io.Reader) (io.Reader, error)

DecodeHTMLBody returns an decoding reader of the html Body for the specified `charset` If `charset` is empty, DecodeHTMLBody tries to guess the encoding from the content

func GetHostByURL

func GetHostByURL(url string) string

func GetLogger

func GetLogger() *logger.Logger

func GetPage

func GetPage(url, ua string) (io.Reader, error)

func IsExist

func IsExist(fileName string) bool

func Nodetext

func Nodetext(node *html.Node) string

func ParseRule

func ParseRule(rule string) (string, int, int)

return selector,length of rules, index of selector

func ParseRules

func ParseRules(doc interface{}, rule string) (*goquery.Selection, string)

func PostPage

func PostPage(url, key, ua string) (io.Reader, error)

func RemoveNodes

func RemoveNodes(srcNodes, removeNodes []*html.Node) []*html.Node

func URLFix

func URLFix(uri, host string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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