mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-16 07:16:40 +00:00
fix for symbols without a dividend
This commit is contained in:
parent
96321d7c07
commit
487ab10933
@ -234,7 +234,7 @@ class IEX_Symbol:
|
|||||||
|
|
||||||
IEXurl = f"https://cloud.iexapis.com/stable/stock/{symbol}/dividends/next?token={self.IEX_TOKEN}"
|
IEXurl = f"https://cloud.iexapis.com/stable/stock/{symbol}/dividends/next?token={self.IEX_TOKEN}"
|
||||||
response = r.get(IEXurl)
|
response = r.get(IEXurl)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200 and response.json():
|
||||||
IEXData = response.json()[0]
|
IEXData = response.json()[0]
|
||||||
keys = (
|
keys = (
|
||||||
"amount",
|
"amount",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user