我需要从Reverso Context中获得带有单词翻译的示例句子
首先,我尝试获取整个结果页面数据:
import requests
print(requests.get("https://context.reverso.net/translation/english-russian/cat").text)
我在这里遇到了一个问题-服务器知道我正在通过一个机器人访问它:我的应用程序没有得到我需要的东西,除此之外,还得到了其他东西:
<p class="text" id="text-en" style="display: none">
You've been denied access â IP blacklisted<br/>
Your IP <b class="ip"></b> has been considered as sending illegitimate traffic to our servers.<br/>
If you think your traffic is legitimate, please fill in the form below so we could investigate why you were blacklisted.<br/><br/>
Thank you,<br/>
The Reverso Team
</p>
有没有办法欺骗服务器并用示例获取页面
注:我试图为这个网站找到一个Python API,但什么也找不到
一旦你能够访问网站,你就可以找到这样的例句
首先尝试更改请求头中的用户代理,使自己看起来像普通的web浏览器。请参阅https://2.python-requests.org/en/v1.0.4/user/quickstart/#custom-headers,谷歌用户代理标题
相关问题 更多 >
编程相关推荐