MCPcopy
hub / github.com/hu17889/go_spider / GetAllByRequest

Method GetAllByRequest

core/spider/spider.go:108–121  ·  view source on GitHub ↗

Deal with several urls and return the PageItems slice

(reqs []*request.Request)

Source from the content-addressed store, hash-verified

106
107// Deal with several urls and return the PageItems slice
108func (this *Spider) GetAllByRequest(reqs []*request.Request) []*page_items.PageItems {
109 // push url
110 for _, req := range reqs {
111 //req := request.NewRequest(u, respType, urltag, method, postdata, header, cookies)
112 this.AddRequest(req)
113 }
114
115 pip := pipeline.NewCollectPipelinePageItems()
116 this.AddPipeline(pip)
117
118 this.Run()
119
120 return pip.GetCollected()
121}
122
123func (this *Spider) Run() {
124 if this.threadnum == 0 {

Callers 2

GetByRequestMethod · 0.95
mainFunction · 0.80

Calls 4

AddRequestMethod · 0.95
AddPipelineMethod · 0.95
RunMethod · 0.95
GetCollectedMethod · 0.95

Tested by

no test coverage detected