如何在JavaScript中无需CloudFlare获取数据?
获取不起作用,
const response = await fetch(url)
const html = await response.json()
它将返回Cloudflare的页面!
我应该怎么办?
The fetch doesn't work
const response = await fetch(url)
const html = await response.json()
It returns a page with Cloudflare!
What should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要绕过Cloudflare,您可以尝试此软件包 cloudscraper ,或者您可以使用无头铬的内容获取内容,并且受欢迎的是 puppeteer 。
to bypass cloudflare you can either try this package cloudscraper or you can get the content using a headless Chrome and the popular is Puppeteer.