如何修复scray中的403响应

2024-09-30 02:22:06 发布

您现在位置:Python中文网/ 问答频道 /正文

http://prntscr.com/o56670

请检查屏幕截图

我在我的终端中使用python3和scrapy。在

获取(“https://angel.co/adil-wali”)

当请求链接时,它用403响应。在

所以我已经改变和旋转用户代理和机器人服从错误,但仍然显示403响应,所以这次我买了crawera计划,但crawlera仍然说523响应

您知道为什么在scrapy shell中请求返回403而不是200个响应吗


Tags: 用户httpscomhttp终端屏幕链接python3
1条回答
网友
1楼 · 发布于 2024-09-30 02:22:06

尝试向您的请求添加标头:

fetch(
    "https://angel.co/adil-wali", 
    headers={
        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
        "accept-language": "en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7",
        "cache-control": "no-cache",
        "pragma": "no-cache",
        "upgrade-insecure-requests": "1"
    }
)

通过这种方法,我能够从提到的URL得到响应200。在

相关问题 更多 >

    热门问题