Hello!
I am trying to run the following code in my PA virtualenv:
def get_dividend_data(date):
url = 'https://api.nasdaq.com/api/calendar/dividends'
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0",
"Accept": "application/json",
}
params = {'date': date}
response = requests.get(url=url, headers=headers, params=params)
return response.json()
It runs like a charm when I run it locally, but when I run in it on PythonAnywhere it gets hung up on the API call and just stalls forever. Additionally, I have been able to make other similar API calls within my virtualenv so it seems like the issue is with this call specifically.