from datetime import date
from nsepy import get_history
print("processing symbol ", s)
try:
df = get_history(symbol="SBIN", start=date(2021,1,1), end=date(2021,1,31))
print(df)
except Exception as e:
print(str(e))
print("Failed while retriving data for ", s)
Below is the code i'm using
from datetime import date from nsepy import get_history
print("processing symbol ", s) try: df = get_history(symbol="SBIN", start=date(2021,1,1), end=date(2021,1,31)) print(df) except Exception as e: print(str(e)) print("Failed while retriving data for ", s)
Output
Empty DataFrame Columns: [Symbol, Series, Prev Close, Open, High, Low, Last, Close, VWAP, Volume, Turnover, Trades, Deliverable Volume, %Deliverble] Index: []