亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用 chromedp 進行代理

如何使用 chromedp 進行代理

Go
偶然的你 2023-07-10 17:25:47
我想截取亞馬遜等網站(數千頁)的屏幕截圖。我嘗試了一些代碼,但在屏幕截圖中出現了驗證碼或流量錯誤。所以我想用 chromedp 添加代理。ctx, cancel := chromedp.NewContext(context.Background())defer cancel()chromedp.ProxyServer("http://username:[email protected]:31280")chromedp.Run(ctx,        chromedp.Navigate("http://wtfismyip.com"),        chromedp.Sleep(3*time.Second),        chromedp.ActionFunc(func(ctxt context.Context) error {            _, _, contentRect, err := page.GetLayoutMetrics().Do(ctxt)            v := page.Viewport{                X:      contentRect.X,                Y:      contentRect.Y,                Width:  contentRect.Width,                Height: contentRect.Height,                Scale:  1,            }            buf, err := page.CaptureScreenshot().WithClip(&v).Do(ctxt)            log.Printf("Write %v", "/tmp/ss.png")            ioutil.WriteFile("/tmp/ss.png", buf, 0644)            return err        }))也嘗試過這個,但不起作用。
查看完整描述

1 回答

?
慕容708150

TA貢獻1831條經驗 獲得超4個贊

o := append(chromedp.DefaultExecAllocatorOptions[:],

? //... any options here

? chromedp.ProxyServer("http://username:[email protected]:31280"),?

)


查看完整回答
反對 回復 2023-07-10
  • 1 回答
  • 0 關注
  • 464 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號