common

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConversionFormat

func ConversionFormat(form ff.Form, resList map[string]string) map[string]string

ConversionFormat 处理格式转换

func DealCoding

func DealCoding(html string, header http.Header) (string, error)

DealCoding 解决编码问题

func DownImg

func DownImg(form form.Form, url string, item form.Field, singleFieldMap *sync.Map) string

DownImg 下载图片(包括生成文件夹)

func ErrorLine

func ErrorLine(form form.Form, msg string)

ErrorLine 错误日志

func GetChannelList added in v0.0.4

func GetChannelList(form form.Form, callback func(listUrl string))

GetChannelList 获取栏目链接

func GetCharsetByContentType added in v0.0.4

func GetCharsetByContentType(contentType string) string

GetCharsetByContentType 从contentType中获取编码

func GetDir

func GetDir(path string, singleFieldMap *sync.Map) string

func GetHref

func GetHref(href string, host string) string

GetHref 获取完整a链接

func GetHttpClient added in v0.0.15

func GetHttpClient(form ff.Form) *http2.C

GetHttpClient 获取http客户端

func If

func If(condition bool, trueVal, falseVal interface{}) interface{}

If 伪三元运算

func OnlyList added in v0.0.11

func OnlyList(form ff.Form, s *goquery.Selection) bool

OnlyList 只爬列表

func ResolveFields

func ResolveFields(field map[string]interface{}) map[string]form.Field

ResolveFields 解析字段

func ResolveSelector

func ResolveSelector(form form.Form, doc *goquery.Document, selector map[string]form.Field) map[string]string

ResolveSelector 解析选择器

Types

This section is empty.

Jump to

Keyboard shortcuts

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