[英]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.