knox 修订了这个 Gist . 跳至此修订
1 file changed, 6 insertions
yfinance-10.py(file created)
@@ -0,0 +1,6 @@ | |||
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 |
更新
更早