如何使用Chromedp打开一个由Cloudflare保护的网站?

huangapple go评论128阅读模式
英文:

How to open a website protected by Cloudflare using Chromedp?

问题

如何打开由Cloudflare保护的网站?例如https://coinlist.co,

我只想使用带有headless = true标志的Chromepd打开https://coinlist.co,但是Chrome提示“Chrome正在被自动化测试软件控制”,并且Chrome页面在Cloudflare页面上被阻止。看起来Cloudflare可以检测到Chromedp。

英文:

How to open a website protected by Cloudflare? such as https://coinlist.co,

I just want to open https://coinlist.co using Chromepd with headless = true flag, but Chrome prompts that "Chrome is being controlled by automated test software", and the chrome page blocks at the Cloudflare page. It seems like Cloudflare can detect the Chromedp.

答案1

得分: 2

你可以尝试使用基于puppeteer stealth插件github.com/go-rod/stealth包,示例如下:


import (
	"github.com/chromedp/chromedp"
	"github.com/go-rod/stealth"
)

chromedp.Run(
	ctx,
	chromedp.Evaluate(stealth.JS, nil),
)

如果这不起作用,你可能需要使用一个验证码解决器,比如2captcha。

英文:

You can try using the github.com/go-rod/stealth package based on the puppeteer stealth plugin like below:


import (
	"github.com/chromedp/chromedp"
	"github.com/go-rod/stealth"
)

chromedp.Run(
	ctx,
	chromedp.Evaluate(stealth.JS, nil),
)

If that doesn't work then you may need to use a captcha solver like 2captcha.

huangapple
  • 本文由 发表于 2021年12月17日 21:16:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/70393785.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定