无法使用Yfinance库,出现多个错误



昨晚能够使用,并复制和粘贴他的源代码在pypi.org上的yfinance和方法今天不再工作。API是否有问题,或者我需要在代码中更新一些东西?

import yfinance as yf
msft = yf.Ticker("MSFT")
# get stock info
msft.info
# get historical market data
hist = msft.history(period="max")
# show meta information about the history (requires history() to be called first)
msft.history_metadata
# show actions (dividends, splits, capital gains)
msft.actions
# show dividends
msft.dividends
# show splits
msft.splits

# show capital gains (for mutual funds & etfs)
msft.capital_gains
# show share count
msft.shares
# show financials:
# - income statement
msft.income_stmt
msft.quarterly_income_stmt
# - balance sheet
msft.balance_sheet
msft.quarterly_balance_sheet
# - cash flow statement
msft.cashflow
msft.quarterly_cashflow
# see `Ticker.get_income_stmt()` for more options
# show major holders
msft.major_holders
# show institutional holders
msft.institutional_holders
# show mutualfund holders
msft.mutualfund_holders
# show earnings
msft.earnings
msft.quarterly_earnings
# show sustainability
msft.sustainability
# show analysts recommendations
msft.recommendations
msft.recommendations_summary
# show analysts other work
msft.analyst_price_target
msft.revenue_forecasts
msft.earnings_forecasts
msft.earnings_trend
# show next event (earnings, etc)
msft.calendar
# Show future and historic earnings dates, returns at most next 4 quarters and last 8 quarters by default. 
# Note: If more are needed use msft.get_earnings_dates(limit=XX) with increased limit argument.
msft.earnings_dates
# show ISIN code - *experimental*
# ISIN = International Securities Identification Number
msft.isin
# show options expirations
msft.options
# show news
msft.news
# get option chain for specific expiration
opt = msft.option_chain('YYYY-MM-DD')
# data available via: opt.calls, opt.puts

获取错误"self. _scraper (self.proxy)"以及"quote_summary_store = json_data['QuoteSummaryStore']TypeError:字符串索引必须是整数">

如果有人知道为什么这可能不起作用,我将不胜感激。

自周六以来我有同样的问题,yfinance==0.2.4确实修复了这个问题。由于某种原因,我的IDE使用了一个指向0.2.3的不同实例。检查yf使用的版本version

最新更新