![](/img/trans.png)
[英]Shopify API Orders throws 429 status code (too many requests) after few POST request
[英]Requests returns Too Many Requests status code
目标是为帐户页面返回resp.text
当您运行此 function 时,您会得到响应代码429
,表明发出了太多请求。
即使使用 proxychains proxychains python3 file.py
运行脚本,它也会返回相同的状态代码
文件.py
import requests
def g3t_usr(acc):
""" Surf to account page """
resp = requests.get(f'https://www.instagram.com/{acc}/')
if resp.status_code == 200:
return resp.text
else:
print (resp.status_code)
return resp.text
acc="<some_random_user>"
g3t_usr(acc)
Instagram 是否检查 python 请求发出的请求并标记它们
尝试在 header 中指定“用户代理”以使您的请求更“真实”,如下所示: requests.get(f'https://www.instagram.com/{acc}/', headers={"User-Agent": "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0"})
在我这边,它起作用了,我得到了状态码 200。
祝您好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.