extract

package
v0.0.0-...-b1b21d8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

README

功能概述

  • 从json中智能提取列表
  • 从dom中智能提取列表
  • 从dom中智能提取内容

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Content

func Content(html *bs4.Client) *bs4.Client

解析dom 内容

func Json

func Json(data gjson.Result) []gjson.Result

解析json 中的列表

func Lis

func Lis(html *bs4.Client, options ...ListOption) [][]*NodeA

解析dom 列表

func Lis2

func Lis2(html *bs4.Client, html2 *bs4.Client, options ...ListOption) [][]*NodeA

解析dom 多个 列表

Types

type ListOption

type ListOption struct {
	HasTime  bool     //是否有时间
	Keywords []string //列表关键词
}

type NodeA

type NodeA struct {
	Node  *bs4.Client //当前节点
	Time  string      //发布时间
	Href  string      //发布地址
	Title string      //标题
	// contains filtered or unexported fields
}

func (*NodeA) MainNode

func (obj *NodeA) MainNode() *bs4.Client

func (*NodeA) Score

func (obj *NodeA) Score() float64

Jump to

Keyboard shortcuts

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