url="https://www.nseindia.com/companies-listing/corporate-filings-actions"
# second url I am trying
# url = "https://www.nseindia.com/json/CorporateFiling/CF-corpactions-equity.json"
I am trying to get the json response.
I have tried a bunch of the suggested actions in similar posts.
import requests as r
headers = {
"Connection": "keep-alive",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
}
resp = r.get(url, headers=headers)
resp.json()
## Stuck for 20 minutes no response.
I tried a timeout:
resp = r.get(url, headers=headers, timeout=20)
# Timed out
Also tried a catch except block but still not working.
What am I doing wrong here?