doubangroup

package
v0.0.0-...-278ce41 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentRe           = `<div class="topic-content">[\s\S]*?阳台[\s\S]*?<div class="aside">`
	FindSumRoomTaskName = "find_douban_sun_room"
)

Variables

View Source
var DoubangroupTask = &spider.Task{
	Options: spider.Options{Name: FindSumRoomTaskName},
	Rule: spider.RuleTree{
		Root: func() ([]*spider.Request, error) {
			var roots []*spider.Request
			for i := 0; i < 25; i += 25 {
				roots = append(roots, &spider.Request{
					URL:      fmt.Sprintf(discussionURL, i),
					Method:   "GET",
					Priority: 1,
					RuleName: "解析网站URL",
				})
			}

			return roots, nil
		},
		Trunk: map[string]*spider.Rule{
			"解析网站URL": {ParseFunc: ParseURL},
			"解析阳台房":   {ParseFunc: GetSunRoom},
		},
	},
}

Functions

func GetSunRoom

func GetSunRoom(ctx *spider.Context) (spider.ParseResult, error)

func ParseURL

func ParseURL(ctx *spider.Context) (spider.ParseResult, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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