第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

GoColly 為每個(gè)請(qǐng)求設(shè)置代理

GoColly 為每個(gè)請(qǐng)求設(shè)置代理

Go
慕田峪4524236 2023-07-17 16:41:53
我開始對(duì)付科利。我正在嘗試為每個(gè)請(qǐng)求設(shè)置代理。但所有請(qǐng)求都不經(jīng)過代理它應(yīng)該有效 https://github.com/gocolly/colly/blob/master/request.go#L52我已將其添加到我的代碼中。但請(qǐng)求像以前一樣沒有代理c.OnRequest(func(r *colly.Request) {    r.ProxyURL = "..."    }也許我沒有正確理解它應(yīng)該如何工作
查看完整描述

1 回答

?
qq_遁去的一_1

TA貢獻(xiàn)1725條經(jīng)驗(yàn) 獲得超8個(gè)贊

ProxyURL您是否嘗試過在收集器上設(shè)置它,而不是在回調(diào)函數(shù)中設(shè)置?


// SetProxy sets a proxy for the collector. This method overrides the previously

// used http.Transport if the type of the transport is not http.RoundTripper.

// The proxy type is determined by the URL scheme. "http"

// and "socks5" are supported. If the scheme is empty,

// "http" is assumed.

func (c *Collector) SetProxy(proxyURL string) error {

    proxyParsed, err := url.Parse(proxyURL)

    if err != nil {

        return err

    }


    c.SetProxyFunc(http.ProxyURL(proxyParsed))


    return nil

}


查看完整回答
反對(duì) 回復(fù) 2023-07-17
  • 1 回答
  • 0 關(guān)注
  • 187 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)