There are some great libraries that can do a trick for you. For example, yfinance
.
You can refresh values using your own script.
Here is the basic snippet for demo.
# pip install yfinance
import yfinance as yfin
stockName = 'AMZN'
startDate = datetime.date(1998, 1, 1).strftime('%Y-%m-%d')
endDate = datetime.date(2019, 12, 31).strftime('%Y-%m-%d')
df = yfin.download(stockName, start = startDate, end = endDate, progress=True)
df['Date'] = df.index
df = df.reset_index(drop=True)
df = df.reindex(columns=['Date','Open','High','Low','Close','Adj Close','Volume'])
df
Here is your dataframe that you can use for other purposes.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…