Cloudflare 在我抓取网站时拒绝我的访问

Cloudflare denies my access when I scraped a website

我用了cloudscraper to scrape this website oddschecker。我 运行 它在我的本地计算机上运行良好。但是当我使用 Digital Ocean VPS 时,Cloudflare 拒绝了我的访问,并显示一条错误消息:

Access denied

This website is using a security service to protect itself from online attacks.

我不确定那是什么意思 - Cloudflare 是否阻止了我的 VPS 的 IP 地址?我必须使用代理来抓取它吗?

是的,您看到的这个错误是由于 Cloudflare firewall rule that you are hitting. The Cloudflare firewall has a list of 20 different triggers to block/allow requests so it's hard to say exactly if is the IP trigger that's being blocked in this case but that's generally the case. See some examples here

如果您甚至无法使用新 IP 从一开始就访问该站点 address/VPS,则触发器可能与您的请求行为有关,而不是来源 - 例如速率限制(尽管在这种情况下错误消息会有所不同)、每分钟请求数、用于访问的方法、网络块 (ASN) 的信誉等