yfinance-10.py
· 237 B · Python
原始檔案
import requests_cache
session = requests_cache.CachedSession('yfinance.cache')
session.headers['User-agent'] = 'my-program/1.0'
ticker = yf.Ticker('msft', session=session)
# The scraped response will be stored in the cache
ticker.actions
1 | import requests_cache |
2 | session = requests_cache.CachedSession('yfinance.cache') |
3 | session.headers['User-agent'] = 'my-program/1.0' |
4 | ticker = yf.Ticker('msft', session=session) |
5 | # The scraped response will be stored in the cache |
6 | ticker.actions |