gpt4 book ai didi

javascript - "The owner of this website has banned your access based on your browser' s signature"...在 python 程序中的 url 请求

转载 作者:太空狗 更新时间:2023-10-29 17:31:34 28 4
gpt4 key购买 nike

当使用 urllib2 在 python(准确地说是 Entought Canopy)上做一个简单的请求时,服务器拒绝我访问:

data = urllib.urlopen(an url i cannot post because of reputation, params)

print data.read()

错误:

Access denied | play.pokemonshowdown.com used CloudFlare to restrict access

The owner of this website (play.pokemonshowdown.com) has banned your access based on your browser's signature (14e894f5bf8d0920-ua48).

这显然是一个普遍的问题,所以我在网上找到了一些线索。

https://support.cloudflare.com/hc/en-us/articles/200171806-Error-1010-The-owner-of-this-website-has-banned-your-access-based-on-your-browser-s-signature :

A firewall, proxy, a browser plugin or extension may be throwing a false positive. Try visiting the site with a different browser as an alternative way of accessing the site.

https://support.cloudflare.com/hc/en-us/articles/200170176-Why-am-I-getting-a-Checking-your-Browser-before-accessing-message-before-entering-a-site-on-CloudFlare- :

The "Checking your browser before accessing (insertsite.com) occurs when the site owner has turned on a DDoS protection and mitigation tool called "I'm Under Attack". The page will generally go away and grant you access to the site after 5 seconds.

Note: You will need to have both JavaScript and Cookies turned on in your browser to pass the check. The check is in place to make sure that you are not part of a botnet."

答案很清楚,除了这件事...... *我没有使用任何浏览器!该请求是通过 python 程序完成的,带有 urllib.urlopen 请求 ...

这是否意味着我应该在……Enthought Canopy 中打开 cookie 和 JavaScript?这句话能构成任何句子吗?当尝试使用来自编程控制台的基本请求访问该站点时,我几乎不了解此浏览器特定检查激活。这就是为什么我请求你的帮助。

为什么会这样?如何绕过它?

最佳答案

此站点“检查”的不是您的浏览器,而是“用户代理”——您的客户端程序(浏览器、Python 脚本或其他)最终作为请求 header 发送的字符串。您可以指定另一个用户代理,cf Changing user agent on urllib2.urlopen .

关于javascript - "The owner of this website has banned your access based on your browser' s signature"...在 python 程序中的 url 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24913699/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com