Exemple #1
0
// 根据响应流运行指定解析规则,不推荐在规则中使用
func (self *Spider) GoRule(resp *context.Response) {
	self.RuleTree.Nodes[resp.GetRuleName()].ParseFunc(self, resp)
}
Exemple #2
0
// 获取任务规则采集语义字段
func (self *Spider) GetOutFeild(resp *context.Response, index int) string {
	return self.RuleTree.Nodes[resp.GetRuleName()].OutFeild[index]
}
Exemple #3
0
// 根据响应流运行指定解析Rule,仅用于crawl模块,Rule中请使用Parse()代替
func (self *Spider) ExecParse(resp *context.Response) {
	self.RuleTree.Trunk[resp.GetRuleName()].ParseFunc(self, resp)
}