12345678910111213141516171819202122232425262728 |
- package qianlima
- import (
- "fmt"
- "git.aionnect.com/hello-go/spider/common"
- "git.aionnect.com/hello-go/spider/spiders"
- "git.aionnect.com/hello-go/spider/spiders/qianlima/items"
- "net/http"
- "testing"
- )
- func TestVisitorSpider(t *testing.T) {
- // 从起始页开始执行爬虫
- params := &items.PagingParams{PagingNo: 1, DaysLimit: 7}
- startingUrl := fmt.Sprintf(TargetUrl, params.PagingNo)
- target := &common.Target{
- Key: VisitorPaging,
- Method: http.MethodPost,
- URL: startingUrl,
- Referer: RefererUrl,
- Item: params,
- }
- spiders.Run(target,
- NewVisitorPagingSpider(),
- NewVisitorDetailSpider(),
- )
- fmt.Println("Done!")
- }
|