Deal with several urls and return the PageItems slice
(reqs []*request.Request)
| 106 | |
| 107 | // Deal with several urls and return the PageItems slice |
| 108 | func (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 | |
| 123 | func (this *Spider) Run() { |
| 124 | if this.threadnum == 0 { |
no test coverage detected