简体   繁体   中英

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 .

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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