func (xc *xiciProxy) fetch() (err error) {
	doc, err := xc.fetchPage("xici", "/%d")
	if err != nil || doc == nil {
		return
	}
	if xc.maxPage == 0 {
		pages := doc.Find(".pagination a")
		value := pages.Eq(pages.Length() - 2).Text()
		max, _ := strconv.Atoi(value)
		if max == 0 {
			max = 1
		}
		if xc.limitMaxPage != 0 && max > xc.limitMaxPage {
			max = xc.limitMaxPage
		}
		xc.maxPage = max
	}
	doc.Find("#ip_list tr").Each(func(i int, s *goquery.Selection) {
		if i == 0 {
			return
		}
		tdList := s.Find("td")
		ip := tdList.Eq(1).Text()
		port := tdList.Eq(2).Text()
		anonymous := tdList.Eq(4).Text() == "高匿"
		category := strings.ToLower(tdList.Eq(5).Text())
		if ip == "" ||
			port == "" ||
			category == "" ||
			xc.fetchListener == nil {
			return
		}
		xc.fetchListener(&Proxy{
			IP:        ip,
			Port:      port,
			Anonymous: anonymous,
			Category:  category,
		})
	})
	return
}
Fetch fetch proxy list from xici
package crawler
import (
	"net/http"
	"strconv"
	"strings"
	"time"
	"github.com/PuerkitoBio/goquery"
	"github.com/vicanso/go-axios"
)
type (
	xiciProxy struct {
		baseProxyCrawler
	}
)
const (
	ProxyXiCi = "xici"
)
func NewXiciProxy(interval time.Duration) *xiciProxy {
	header := make(http.Header)
	header.Set("User-Agent", defaultUserAgent)
	ins := axios.NewInstance(&axios.InstanceConfig{
		BaseURL: "https://www.xicidaili.com/nn",
		Headers: header,
		Timeout: defaulttProxyTimeout,
	})
	xiciProxy := new(xiciProxy)
	xiciProxy.interval = interval
	xiciProxy.ins = ins
	return xiciProxy
}
func (xc *xiciProxy) Start() {
	xc.status = StatusRunning
	for {
		if xc.status != StatusRunning {
			return
		}
		_ = xc.fetch()
		time.Sleep(xc.interval)
	}
}