Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Colly ¶
type Colly struct { C *colly.Collector Cdetail *colly.Collector WriteNum int //写入次数 WriteChannle chan map[string]string // contains filtered or unexported fields }
func (*Colly) GetDContent ¶
根据规则抓取数据
type PageRule ¶
type PageRule struct { Type int `json:"type"` //采集规则 0 不采集分页 1 html 2接口数据 Page int `json:"page"` //采集第几页 0为采集全部 Num int `json:"num"` //总共采集几页 0为无限制 Match string `json:"match"` //分页提取规则 type为1:则输入jquery提取分页按钮 2:输入分页连接其中 分页处用{page}替换 }
分页规则
type Rule ¶
type Rule struct { Type int `json:"type"` //采集规则 1 html 2接口数据 Name string `json:"name"` //规则名称 Field string `json:"field"` //规则映射的字段名称 Match string `json:"match"` //type=2 则为正则表达式前缀,type=1 html 则为jquery selector规则 PageRule PageRule `json:"pagerule"` //分页规则 SubMatch string `json:"submatch"` //内容规则 jquery selector SubRule []SubRule `json:"subrules"` //内容详细内容 }
规则结构
Click to show internal directories.
Click to hide internal directories.