小编Ice*_*amz的帖子

Python请求响应403禁止

所以我试图抓取这个网站:https://www.auto24.ee 我能够毫无问题地从中抓取数据,但今天它给了我“响应 403”。我尝试使用代理,将更多信息传递给标头,但不幸的是似乎没有任何效果。我在互联网上找不到任何解决方案,我尝试了不同的方法。之前运行没有任何问题的代码:

import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36',
}

page = requests.get("https://www.auto24.ee/", headers=headers)

print(page)
Run Code Online (Sandbox Code Playgroud)

python http-status-code-403 python-requests python-requests-html

4
推荐指数
1
解决办法
1万
查看次数