简体   繁体   English

如何使用 python 绕过响应 503

[英]How to bypass response 503 with python

I am trying to scrape some information for my assignment but return response 503 from https://www.klsescreener.com/v2/stocks/view/3182 .我正在尝试为我的作业抓取一些信息,但从https://www.klsescreener.com/v2/stocks/view/3182返回响应 503。

the code I am using is我正在使用的代码是

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'}
page = requests.get('https://www.klsescreener.com/v2/stocks/view/'+stockcode[x],headers=headers)

is it any other way that I can bypass the response 503?有没有其他方法可以绕过响应 503?

Please do a curl request on the API in order to check if the API is functional or not, Keeping this in mind 503 is generally the error which means you're not getting anything from the respective URL. Please do a curl request on the API in order to check if the API is functional or not, Keeping this in mind 503 is generally the error which means you're not getting anything from the respective URL.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM