2020-05-05 復(fù)習(xí)yfinance

自從Yahoo! finance(雅虎財(cái)經(jīng))部門停止更新了他們的歷史數(shù)據(jù)API初橘,許多依賴它的程序停止工作劣摇。yfinance旨在通過提供一種可靠的缩挑、線程化的坐搔、Python化的方式從下載歷史股票交易市場(chǎng)數(shù)據(jù)來解決這個(gè)問題巧勤。

這個(gè)庫(kù)最初被命名為fix-yahoo-finance腊凶,但后來作者將其重命名為yfinance涨共,因?yàn)樽髡卟辉僬J(rèn)為它只是一個(gè)“修復(fù)fix”工具庐椒。出于競(jìng)爭(zhēng)力落后的原因测暗,fix-yahoo-finance現(xiàn)在導(dǎo)入并使用yfinance央串,但您應(yīng)該直接安裝并使用yfinance

Ticker模塊

Ticker 模塊可以讓使用者用一種更Pythonic的方式獲取股市交易數(shù)據(jù):

#導(dǎo)入`yfinance`庫(kù)
import yfinance as yf
#定義msft導(dǎo)入微軟的股票信息
msft = yf.Ticker("MSFT")

# 獲取股票信息
msft.info

# 獲取歷史交易信息
hist = msft.history(period="max")

# 顯示操作(分紅碗啄、拆分)(dividends, splits)
msft.actions

# show dividends
msft.dividends

# show splits
msft.splits

# show financials
msft.financials
msft.quarterly_financials

# show major holders展示主要持有人
stock.major_holders

# show institutional holders展示機(jī)構(gòu)持有人
stock.institutional_holders

# show balance heet顯示資產(chǎn)負(fù)債表
msft.balance_sheet
msft.quarterly_balance_sheet

# show cashflow 現(xiàn)金流量表
msft.cashflow
msft.quarterly_cashflow
 
# show earnings收益
msft.earnings
msft.quarterly_earnings

# show sustainability 可持續(xù)性
msft.sustainability

# show analysts recommendations 向分析師展示建議
msft.recommendations

# show next event (earnings, etc)
msft.calendar

# show ISIN code - *experimental*
# ISIN = International Securities Identification Number
msft.isin

# show options expirations 顯示期權(quán)到期
msft.options

# get option chain for specific expiration 獲取特定到期的期權(quán)鏈
opt = msft.option_chain('YYYY-MM-DD')
# data available via: opt.calls, opt.puts數(shù)據(jù)可通過以下方式獲得:opt.calls质和,opt.puts

如果要使用代理服務(wù)器下載數(shù)據(jù),請(qǐng)使用:

import yfinance as yf

msft = yf.Ticker("MSFT")

msft.history(..., proxy="PROXY_SERVER")
msft.get_actions(proxy="PROXY_SERVER")
msft.get_dividends(proxy="PROXY_SERVER")
msft.get_splits(proxy="PROXY_SERVER")
msft.get_balance_sheet(proxy="PROXY_SERVER")
msft.get_cashflow(proxy="PROXY_SERVER")
msgt.option_chain(..., proxy="PROXY_SERVER")
...

要初始化多個(gè)股票代碼對(duì)象稚字,請(qǐng)使用:

import yfinance as yf

tickers = yf.Tickers('msft aapl goog')
# ^ returns a named tuple of Ticker objects

# access each ticker using (example)
tickers.msft.info
tickers.aapl.history(period="1mo")
tickers.goog.actions

獲取多個(gè)股票的數(shù)據(jù):

import yfinance as yf
data = yf.download("SPY AAPL", start="2017-01-01", end="2017-04-30")

作者還添加了一些便捷參數(shù)來使工作更輕松 :)

data = yf.download(  # or pdr.get_data_yahoo(...
        # tickers list or string as well
        tickers = "SPY AAPL MSFT",

        # use "period" instead of start/end
        # valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
        # (optional, default is '1mo')
        period = "ytd",

        # fetch data by interval (including intraday if period < 60 days)
        # valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
        # (optional, default is '1d')
        interval = "1m",

        # group by ticker (to access via data['SPY'])
        # (optional, default is 'column')
        group_by = 'ticker',

        # adjust all OHLC automatically
        # (optional, default is False)
        auto_adjust = True,

        # download pre/post regular market hours data
        # (optional, default is False)
        prepost = True,

        # use threads for mass downloading? (True/False/Integer)
        # (optional, default is True)
        threads = True,

        # proxy URL scheme use use when downloading?
        # (optional, default is None)
        proxy = None
    )

pandas_datareader覆蓋

如果您的代碼使用pandas_datareader饲宿,并且您想更快地下載數(shù)據(jù),則可以“劫持” pandas_datareader.data.get_data_yahoo()方法以使用yfinance胆描,同時(shí)確保返回的數(shù)據(jù)與pandas_datareaderget_data_yahoo()格式相同瘫想。

from pandas_datareader import data as pdr

import yfinance as yf
yf.pdr_override() # <== that's all it takes :-)

# download dataframe
data = pdr.get_data_yahoo("SPY", start="2017-01-01", end="2017-04-30")

安裝

Install yfinance using pip:

$ pip install yfinance --upgrade --no-cache-dir

Install yfinance using conda:

$ conda install -c ranaroussi yfinance

依賴環(huán)境

可先依賴項(xiàng) (if you want to use pandas_datareader)

法律資料

yfinance is distributed under the Apache Software License. See the LICENSE.txt file in the release for details.

今天練習(xí)通過ipython實(shí)現(xiàn),記錄如下:

先激活python的小環(huán)境:

  501  cd /Users/chelsea/pandas-tutorial-master
  502  conda deactivate
  503  history
  504  source venv/bin/activate
  505  ls
  506  cd pythonsp500-plotly-dash-master/
  507  ls
  508  pip install -r requirements.txt
  509  ipython

打開ipython筆記本:記錄里面有些報(bào)錯(cuò)解決了昌讲,有些沒能解決国夜,因?yàn)檫@個(gè)筆記本和jupternotebook不同,不能保存為一個(gè)文件短绸,所以就通過筆記記錄车吹,后面再遇到了問題可以回溯。

(venv) Cheng-MacBook-Pro:pythonsp500-plotly-dash-master chelsea$ ipython
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py:935: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn("Attempting to work in a virtualenv. If you encounter problems, please "
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import yfinance as yf

In [2]: msft = yf.Ticker("MSFT")

In [3]: msft.info
---------------------------------------------------------------------------
SSLCertVerificationError                  Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1318             try:
-> 1319                 h.request(req.get_method(), req.selector, req.data, headers,
   1320                           encode_chunked=req.has_header('Transfer-encoding'))

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1229         """Send a complete request to the server."""
-> 1230         self._send_request(method, url, body, headers, encode_chunked)
   1231

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
   1275             body = _encode(body, 'body')
-> 1276         self.endheaders(body, encode_chunked=encode_chunked)
   1277

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py in endheaders(self, message_body, encode_chunked)
   1224             raise CannotSendHeader()
-> 1225         self._send_output(message_body, encode_chunked=encode_chunked)
   1226

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py in _send_output(self, message_body, encode_chunked)
   1003         del self._buffer[:]
-> 1004         self.send(msg)
   1005

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py in send(self, data)
    943             if self.auto_open:
--> 944                 self.connect()
    945             else:

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py in connect(self)
   1398
-> 1399             self.sock = self._context.wrap_socket(self.sock,
   1400                                                   server_hostname=server_hostname)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
    499         # ctx._wrap_socket()
--> 500         return self.sslsocket_class._create(
    501             sock=sock,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py in _create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
   1039                         raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1040                     self.do_handshake()
   1041             except (OSError, ValueError):

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py in do_handshake(self, block)
   1308                 self.settimeout(None)
-> 1309             self._sslobj.do_handshake()
   1310         finally:

SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

URLError                                  Traceback (most recent call last)
<ipython-input-3-c52d32a3ec1f> in <module>
----> 1 msft.info

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/ticker.py in info(self)
    136     @property
    137     def info(self):
--> 138         return self.get_info()
    139
    140     @property

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/base.py in get_info(self, proxy, as_dict, *args, **kwargs)
    413
    414     def get_info(self, proxy=None, as_dict=False, *args, **kwargs):
--> 415         self._get_fundamentals(proxy)
    416         data = self._info
    417         if as_dict:

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/base.py in _get_fundamentals(self, kind, proxy)
    282         # holders
    283         url = "{}/{}/holders".format(self._scrape_url, self.ticker)
--> 284         holders = _pd.read_html(url)
    285         self._major_holders = holders[0]
    286         self._institutional_holders = holders[1]

~/pandas-tutorial-master/venv/lib/python3.8/site-packages/pandas/io/html.py in read_html(io, match, flavor, header, index_col, skiprows, attrs, parse_dates, thousands, encoding, decimal, converters, na_values, keep_default_na, displayed_only)
   1083         )
   1084     validate_header_arg(header)
-> 1085     return _parse(
   1086         flavor=flavor,
   1087         io=io,

~/pandas-tutorial-master/venv/lib/python3.8/site-packages/pandas/io/html.py in _parse(flavor, io, match, attrs, encoding, displayed_only, **kwargs)
    893
    894         try:
--> 895             tables = p.parse_tables()
    896         except ValueError as caught:
    897             # if `io` is an io-like object, check if it's seekable

~/pandas-tutorial-master/venv/lib/python3.8/site-packages/pandas/io/html.py in parse_tables(self)
    211         list of parsed (header, body, footer) tuples from tables.
    212         """
--> 213         tables = self._parse_tables(self._build_doc(), self.match, self.attrs)
    214         return (self._parse_thead_tbody_tfoot(table) for table in tables)
    215

~/pandas-tutorial-master/venv/lib/python3.8/site-packages/pandas/io/html.py in _build_doc(self)
    731                     pass
    732             else:
--> 733                 raise e
    734         else:
    735             if not hasattr(r, "text_content"):

~/pandas-tutorial-master/venv/lib/python3.8/site-packages/pandas/io/html.py in _build_doc(self)
    712         try:
    713             if is_url(self.io):
--> 714                 with urlopen(self.io) as f:
    715                     r = parse(f, parser=parser)
    716             else:

~/pandas-tutorial-master/venv/lib/python3.8/site-packages/pandas/io/common.py in urlopen(*args, **kwargs)
    139     import urllib.request
    140
--> 141     return urllib.request.urlopen(*args, **kwargs)
    142
    143

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    220     else:
    221         opener = _opener
--> 222     return opener.open(url, data, timeout)
    223
    224 def install_opener(opener):

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in open(self, fullurl, data, timeout)
    523
    524         sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 525         response = self._open(req, data)
    526
    527         # post-process response

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in _open(self, req, data)
    540
    541         protocol = req.type
--> 542         result = self._call_chain(self.handle_open, protocol, protocol +
    543                                   '_open', req)
    544         if result:

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
    500         for handler in handlers:
    501             func = getattr(handler, meth_name)
--> 502             result = func(*args)
    503             if result is not None:
    504                 return result

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in https_open(self, req)
   1360
   1361         def https_open(self, req):
-> 1362             return self.do_open(http.client.HTTPSConnection, req,
   1363                 context=self._context, check_hostname=self._check_hostname)
   1364

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1320                           encode_chunked=req.has_header('Transfer-encoding'))
   1321             except OSError as err: # timeout error
-> 1322                 raise URLError(err)
   1323             r = h.getresponse()
   1324         except:

URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>

In [4]: import ssl

In [5]: ssl._create_default_https_context = ssl._create_unverified_context

In [6]: msft = yf.Ticker("MSFT")

In [7]: msft.info
Out[7]:
{'zip': '98052',
 'sector': 'Technology',
 'fullTimeEmployees': 144000,
 'longBusinessSummary': 'Microsoft Corporation develops, licenses, and supports software, services, devices, and solutions worldwide. Its Productivity and Business Processes segment offers Office, Exchange, SharePoint, Microsoft Teams, Office 365 Security and Compliance, and Skype for Business, as well as related Client Access Licenses (CAL); and Skype, Outlook.com, and OneDrive. It also provides LinkedIn that includes Talent and marketing solutions, and subscriptions; and Dynamics 365, a set of cloud-based and on-premises business solutions for small and medium businesses, large organizations, and divisions of enterprises. Its Intelligent Cloud segment licenses SQL and Windows Servers, Visual Studio, System Center, and related CALs; GitHub that provides a collaboration platform and code hosting service for developers; and Azure, a cloud platform. It also provides support services and Microsoft consulting services to assist customers in developing, deploying, and managing Microsoft server and desktop solutions; and training and certification to developers and IT professionals on various Microsoft products. Its More Personal Computing segment offers Windows OEM licensing and other non-volume licensing of the Windows operating system; Windows Commercial, such as volume licensing of the Windows operating system, Windows cloud services, and other Windows commercial offerings; patent licensing; Windows Internet of Things; and MSN advertising. It also provides Microsoft Surface, PC accessories, and other intelligent devices; Gaming, including Xbox hardware, and Xbox software and services; video games and third-party video game royalties; and Search, including Bing and Microsoft advertising. It sells its products through distributors and resellers; and directly through digital marketplaces, online stores, and retail stores. It has strategic partnerships with Humana Inc., Nokia, Telkomsel, Swiss Re, and Kubota Corporation. The company was founded in 1975 and is headquartered in Redmond, Washington.',
 'city': 'Redmond',
 'phone': '425-882-8080',
 'state': 'WA',
 'country': 'United States',
 'companyOfficers': [],
 'website': 'http://www.microsoft.com',
 'maxAge': 1,
 'address1': 'One Microsoft Way',
 'fax': '425-706-7329',
 'industry': 'Software—Infrastructure',
 'previousClose': 174.57,
 'regularMarketOpen': 174.49,
 'twoHundredDayAverage': 159.58736,
 'trailingAnnualDividendYield': 0.011399439,
 'payoutRatio': 0.3233,
 'volume24Hr': None,
 'regularMarketDayHigh': 178.98,
 'navPrice': None,
 'averageDailyVolume10Day': 40409383,
 'totalAssets': None,
 'regularMarketPreviousClose': 174.57,
 'fiftyDayAverage': 161.73372,
 'trailingAnnualDividendRate': 1.99,
 'open': 174.49,
 'toCurrency': None,
 'averageVolume10days': 40409383,
 'expireDate': None,
 'yield': None,
 'algorithm': None,
 'dividendRate': 2.04,
 'exDividendDate': 1589932800,
 'beta': 0.952031,
 'circulatingSupply': None,
 'startDate': None,
 'regularMarketDayLow': 173.8,
 'priceHint': 2,
 'currency': 'USD',
 'trailingPE': 29.796734,
 'regularMarketVolume': 30372862,
 'lastMarket': None,
 'maxSupply': None,
 'openInterest': None,
 'marketCap': 1356222300160,
 'volumeAllCurrencies': None,
 'strikePrice': None,
 'averageVolume': 56262191,
 'priceToSalesTrailing12Months': 9.77817,
 'dayLow': 173.8,
 'ask': 180.2,
 'ytdReturn': None,
 'askSize': 3000,
 'volume': 30372862,
 'fiftyTwoWeekHigh': 190.7,
 'forwardPE': 28.798712,
 'fromCurrency': None,
 'fiveYearAvgDividendYield': 1.95,
 'fiftyTwoWeekLow': 119.01,
 'bid': 180.48,
 'tradeable': False,
 'dividendYield': 0.0117,
 'bidSize': 2200,
 'dayHigh': 178.98,
 'exchange': 'NMS',
 'shortName': 'Microsoft Corporation',
 'longName': 'Microsoft Corporation',
 'exchangeTimezoneName': 'America/New_York',
 'exchangeTimezoneShortName': 'EDT',
 'isEsgPopulated': False,
 'gmtOffSetMilliseconds': '-14400000',
 'quoteType': 'EQUITY',
 'symbol': 'MSFT',
 'messageBoardId': 'finmb_21835',
 'market': 'us_market',
 'annualHoldingsTurnover': None,
 'enterpriseToRevenue': 9.392,
 'beta3Year': None,
 'profitMargins': 0.33356997,
 'enterpriseToEbitda': 20.324,
 '52WeekChange': 0.4247929,
 'morningStarRiskRating': None,
 'forwardEps': 6.21,
 'revenueQuarterlyGrowth': None,
 'sharesOutstanding': 7583439872,
 'fundInceptionDate': None,
 'annualReportExpenseRatio': None,
 'bookValue': 15.086,
 'sharesShort': 53310482,
 'sharesPercentSharesOut': 0.0069999998,
 'fundFamily': None,
 'lastFiscalYearEnd': 1561852800,
 'heldPercentInstitutions': 0.74192,
 'netIncomeToCommon': 46265999360,
 'trailingEps': 6.002,
 'lastDividendValue': None,
 'SandP52WeekChange': -0.014323652,
 'priceToBook': 11.854699,
 'heldPercentInsiders': 0.014249999,
 'nextFiscalYearEnd': 1625011200,
 'mostRecentQuarter': 1585612800,
 'shortRatio': 0.82,
 'sharesShortPreviousMonthDate': 1584057600,
 'floatShares': 7472418682,
 'enterpriseValue': 1302605463552,
 'threeYearAverageReturn': None,
 'lastSplitDate': 1045526400,
 'lastSplitFactor': '2:1',
 'legalType': None,
 'morningStarOverallRating': None,
 'earningsQuarterlyGrowth': 0.221,
 'dateShortInterest': 1586908800,
 'pegRatio': 2.02,
 'lastCapGain': None,
 'shortPercentOfFloat': 0.0070999996,
 'sharesShortPriorMonth': 55155176,
 'category': None,
 'fiveYearAverageReturn': None,
 'regularMarketPrice': 174.49,
 'logo_url': 'https://logo.clearbit.com/microsoft.com'}

In [8]: msft.history(period="1y")
Out[8]:
              Open    High     Low   Close    Volume  Dividends  Stock Splits
Date
2019-05-06  124.74  126.88  124.46  126.48  24239800        0.0             0
2019-05-07  124.81  125.52  122.60  123.88  36017700        0.0             0
2019-05-08  123.80  124.72  123.12  123.87  28419000        0.0             0
2019-05-09  122.67  124.15  121.96  123.86  27235800        0.0             0
2019-05-10  123.28  126.26  122.20  125.47  30915100        0.0             0
...            ...     ...     ...     ...       ...        ...           ...
2020-04-28  175.59  175.67  169.39  169.81  34392700        0.0             0
2020-04-29  173.22  177.68  171.88  177.43  51286600        0.0             0
2020-04-30  180.00  180.40  176.23  179.21  53875900        0.0             0
2020-05-01  175.80  178.64  174.01  174.57  39370500        0.0             0
2020-05-04  174.49  179.00  173.80  178.84  30336200        0.0             0

[252 rows x 7 columns]

In [9]: msft.actions
Out[9]:
            Dividends  Stock Splits
Date
2019-05-15       0.46           0.0
2019-08-14       0.46           0.0
2019-11-20       0.51           0.0
2020-02-19       0.51           0.0

In [10]: msft.financials
Out[10]:
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []

In [11]: msft.quarterly_financials
Out[11]:
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []

In [12]: stock.major_holders
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-12-4b45999f2678> in <module>
----> 1 stock.major_holders

NameError: name 'stock' is not defined

In [13]: msft.major_holders
Out[13]:
        0                                      1
0   1.42%        % of Shares Held by All Insider
1  74.19%       % of Shares Held by Institutions
2  75.27%        % of Float Held by Institutions
3    4611  Number of Institutions Holding Shares

In [14]: msft.institutional_holders
Out[14]:
                              Holder     Shares  ...   % Out        Value
0         Vanguard Group, Inc. (The)  623667281  ...  0.0820  98352330213
1                     Blackrock Inc.  515197221  ...  0.0677  81246601751
2           State Street Corporation  315672520  ...  0.0415  49781556404
3                           FMR, LLC  239124143  ...  0.0314  37709877351
4            Capital World Investors  180557630  ...  0.0237  28473938251
5      Price (T.Rowe) Associates Inc  175036277  ...  0.0230  27603220882
6      Geode Capital Management, LLC  113401519  ...  0.0149  17883419546
7    Capital International Investors   99996798  ...  0.0131  15769495044
8         Northern Trust Corporation   93192050  ...  0.0123  14696386285
9  Capital Research Global Investors   92776236  ...  0.0122  14630812417

[10 rows x 5 columns]

In [15]: msft.balance_sheet
Out[15]:
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []

In [16]: msft.balancesheet
Out[16]:
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []

In [17]: msft.quarterly_balance_sheet
Out[17]:
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []

In [18]: msft.sustainability
Out[18]:
                                     Value
2020-3
palmOil                              False
controversialWeapons                 False
gambling                             False
socialScore                           9.87
nuclear                              False
furLeather                           False
alcoholic                            False
gmo                                  False
catholic                             False
socialPercentile                         0
peerCount                              100
governanceScore                       5.24
environmentPercentile                    0
animalTesting                        False
tobacco                              False
totalEsg                             15.55
highestControversy                       3
esgPerformance                  UNDER_PERF
coal                                 False
pesticides                           False
adult                                False
percentile                            7.96
peerGroup              Software & Services
smallArms                            False
environmentScore                      0.44
governancePercentile                     0
militaryContract                     False

In [19]: msft.recommendations
Out[19]:
                      Firm       To Grade From Grade Action
Date
2012-03-16  Argus Research            Buy                up
2012-03-19  Hilliard Lyons  Long-Term Buy              main
2012-03-22  Morgan Stanley     Overweight              main
2012-04-03             UBS            Buy              main
2012-04-20   Goldman Sachs        Neutral              main
...                    ...            ...        ...    ...
2020-04-30  Morgan Stanley     Overweight              main
2020-04-30       Citigroup        Neutral              main
2020-04-30     BMO Capital     Outperform              main
2020-04-30   Credit Suisse     Outperform              main
2020-04-30          Mizuho            Buy              main

[281 rows x 4 columns]

In [20]: msft.calendar
Out[20]:
                                    0                    1
Earnings Date     2020-07-16 00:00:00  2020-07-20 00:00:00
Earnings Average                 1.39                 1.39
Earnings Low                     1.35                 1.35
Earnings High                    1.51                 1.51
Revenue Average           36509700000          36509700000
Revenue Low               36053000000          36053000000
Revenue High              37210000000          37210000000

In [21]: msft.isin
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connection.py in _new_conn(self)
    155         try:
--> 156             conn = connection.create_connection(
    157                 (self._dns_host, self.port), self.timeout, **extra_kw

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     83     if err is not None:
---> 84         raise err
     85

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     73                 sock.bind(source_address)
---> 74             sock.connect(sa)
     75             return sock

TimeoutError: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    664             # Make the request on the httplib connection object.
--> 665             httplib_response = self._make_request(
    666                 conn,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    375         try:
--> 376             self._validate_conn(conn)
    377         except (SocketTimeout, BaseSSLError) as e:

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
    993         if not getattr(conn, "sock", None):  # AppEngine might not have  `.sock`
--> 994             conn.connect()
    995

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connection.py in connect(self)
    299         # Add certificate verification
--> 300         conn = self._new_conn()
    301         hostname = self.host

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connection.py in _new_conn(self)
    167         except SocketError as e:
--> 168             raise NewConnectionError(
    169                 self, "Failed to establish a new connection: %s" % e

NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x115f47af0>: Failed to establish a new connection: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    438             if not chunked:
--> 439                 resp = conn.urlopen(
    440                     method=request.method,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    718
--> 719             retries = retries.increment(
    720                 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    435         if new_retry.is_exhausted():
--> 436             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    437

MaxRetryError: HTTPSConnectionPool(host='markets.businessinsider.com', port=443): Max retries exceeded with url: /ajax/SearchController_Suggest?max_results=25&query=Microsoft%20Corporation (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x115f47af0>: Failed to establish a new connection: [Errno 60] Operation timed out'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
<ipython-input-21-34fdac0987fe> in <module>
----> 1 msft.isin

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/ticker.py in isin(self)
    108     @property
    109     def isin(self):
--> 110         return self.get_isin()
    111
    112     @property

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/base.py in get_isin(self, proxy)
    500               'SearchController_Suggest?max_results=25&query=%s' \
    501             % urlencode(q)
--> 502         data = _requests.get(url=url, proxies=proxy).text
    503
    504         search_str = '"{}|'.format(ticker)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/api.py in get(url, params, **kwargs)
     74
     75     kwargs.setdefault('allow_redirects', True)
---> 76     return request('get', url, params=params, **kwargs)
     77
     78

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/api.py in request(method, url, **kwargs)
     59     # cases, and look like a memory leak in others.
     60     with sessions.Session() as session:
---> 61         return session.request(method=method, url=url, **kwargs)
     62
     63

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    528         }
    529         send_kwargs.update(settings)
--> 530         resp = self.send(prep, **send_kwargs)
    531
    532         return resp

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/sessions.py in send(self, request, **kwargs)
    641
    642         # Send the request
--> 643         r = adapter.send(request, **kwargs)
    644
    645         # Total elapsed time of the request (approximately)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    514                 raise SSLError(e, request=request)
    515
--> 516             raise ConnectionError(e, request=request)
    517
    518         except ClosedPoolError as e:

ConnectionError: HTTPSConnectionPool(host='markets.businessinsider.com', port=443): Max retries exceeded with url: /ajax/SearchController_Suggest?max_results=25&query=Microsoft%20Corporation (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x115f47af0>: Failed to establish a new connection: [Errno 60] Operation timed out'))

In [22]: msft.options
Out[22]:
('2020-05-08',
 '2020-05-15',
 '2020-05-22',
 '2020-05-29',
 '2020-06-05',
 '2020-06-12',
 '2020-06-19',
 '2020-07-17',
 '2020-09-18',
 '2020-10-16',
 '2020-12-18',
 '2021-01-15',
 '2021-03-19',
 '2021-06-18',
 '2021-09-17',
 '2022-01-21',
 '2022-03-18',
 '2022-06-17',
 '2022-09-16')

In [23]: import yfinance as yf

In [24]: msft = yf.Ticker("MSFT")

In [25]: msft.get_actions(proxy="PROXY_SERVER")
---------------------------------------------------------------------------
gaierror                                  Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connection.py in _new_conn(self)
    155         try:
--> 156             conn = connection.create_connection(
    157                 (self._dns_host, self.port), self.timeout, **extra_kw

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     60
---> 61     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
     62         af, socktype, proto, canonname, sa = res

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py in getaddrinfo(host, port, family, type, proto, flags)
    917     addrlist = []
--> 918     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    919         af, socktype, proto, canonname, sa = res

gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    661             if is_new_proxy_conn:
--> 662                 self._prepare_proxy(conn)
    663

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in _prepare_proxy(self, conn)
    947         conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers)
--> 948         conn.connect()
    949

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connection.py in connect(self)
    299         # Add certificate verification
--> 300         conn = self._new_conn()
    301         hostname = self.host

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connection.py in _new_conn(self)
    167         except SocketError as e:
--> 168             raise NewConnectionError(
    169                 self, "Failed to establish a new connection: %s" % e

NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x117227e50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    438             if not chunked:
--> 439                 resp = conn.urlopen(
    440                     method=request.method,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    718
--> 719             retries = retries.increment(
    720                 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    435         if new_retry.is_exhausted():
--> 436             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    437

MaxRetryError: HTTPSConnectionPool(host='query1.finance.yahoo.com', port=443): Max retries exceeded with url: /v8/finance/chart/MSFT?period1=-2208988800&period2=1588671618&interval=1d&includePrePost=False&events=div%2Csplits (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x117227e50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')))

During handling of the above exception, another exception occurred:

ProxyError                                Traceback (most recent call last)
<ipython-input-25-90f4b27c292f> in <module>
----> 1 msft.get_actions(proxy="PROXY_SERVER")

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/base.py in get_actions(self, proxy)
    471     def get_actions(self, proxy=None):
    472         if self._history is None:
--> 473             self.history(period="max", proxy=proxy)
    474         actions = self._history[["Dividends", "Stock Splits"]]
    475         return actions[actions != 0].dropna(how='all').fillna(0)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/base.py in history(self, period, interval, start, end, prepost, actions, auto_adjust, back_adjust, proxy, rounding, tz, **kwargs)
    148         # Getting data from json
    149         url = "{}/v8/finance/chart/{}".format(self._base_url, self.ticker)
--> 150         data = _requests.get(url=url, params=params, proxies=proxy)
    151         if "Will be right back" in data.text:
    152             raise RuntimeError("*** YAHOO! FINANCE IS CURRENTLY DOWN! ***\n"

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/api.py in get(url, params, **kwargs)
     74
     75     kwargs.setdefault('allow_redirects', True)
---> 76     return request('get', url, params=params, **kwargs)
     77
     78

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/api.py in request(method, url, **kwargs)
     59     # cases, and look like a memory leak in others.
     60     with sessions.Session() as session:
---> 61         return session.request(method=method, url=url, **kwargs)
     62
     63

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    528         }
    529         send_kwargs.update(settings)
--> 530         resp = self.send(prep, **send_kwargs)
    531
    532         return resp

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/sessions.py in send(self, request, **kwargs)
    641
    642         # Send the request
--> 643         r = adapter.send(request, **kwargs)
    644
    645         # Total elapsed time of the request (approximately)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    508
    509             if isinstance(e.reason, _ProxyError):
--> 510                 raise ProxyError(e, request=request)
    511
    512             if isinstance(e.reason, _SSLError):

ProxyError: HTTPSConnectionPool(host='query1.finance.yahoo.com', port=443): Max retries exceeded with url: /v8/finance/chart/MSFT?period1=-2208988800&period2=1588671618&interval=1d&includePrePost=False&events=div%2Csplits (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x117227e50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')))

In [26]: import yfinance as yf

In [27]: tickers = yf.Tickers('msft aapl goog')

In [28]: tickers.msft.info
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-28-de8923a12a37> in <module>
----> 1 tickers.msft.info

AttributeError: 'Tickers' object has no attribute 'msft'

In [29]: import ssl

In [30]: ssl._create_default_https_context = ssl._create_unverified_context

In [31]: tickers = yf.Tickers('msft aapl goog')

In [32]: tickers.msft.info
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-32-de8923a12a37> in <module>
----> 1 tickers.msft.info

AttributeError: 'Tickers' object has no attribute 'msft'

In [33]: ?yf.Tickers
Init signature: yf.Tickers(tickers)
Docstring:      <no docstring>
File:           /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yfinance/tickers.py
Type:           type
Subclasses:

In [34]: import yfinance as yf

In [35]: data = yf.download("SPR AAPL", start ="2019-01-01", end="2020-05-04")
[*********************100%***********************]  2 of 2 completed

In [36]: data.head
Out[36]:
<bound method NDFrame.head of              Adj Close                  Close  ...       Open    Volume
                  AAPL        SPR        AAPL  ...        SPR      AAPL      SPR
Date                                           ...
2018-12-31  155.037109  71.644485  157.740005  ...  71.089996  35003500   611600
2019-01-02  155.214005  71.972443  157.919998  ...  71.220001  37039700   552300
2019-01-03  139.753540  69.656845  142.190002  ...  71.879997  91312200   410100
2019-01-04  145.719513  72.042007  148.259995  ...  71.209999  58607100   694700
2019-01-07  145.395203  72.807243  147.929993  ...  72.830002  54777800   925800
...                ...        ...         ...  ...        ...       ...      ...
2020-04-27  283.170013  19.139999  283.170013  ...  18.230000  29271900  3400300
2020-04-28  278.579987  20.500000  278.579987  ...  20.170000  28001200  3790000
2020-04-29  287.730011  23.600000  287.730011  ...  22.049999  34320200  7480700
2020-04-30  293.799988  22.160000  293.799988  ...  23.000000  45766000  5097500
2020-05-01  289.070007  20.469999  289.070007  ...  21.500000  60154200  3561300

[337 rows x 12 columns]>

In [37]: data = yf.download("SPR AAPL MSFT",period="ytd",interval="3mo",group_by
    ...: ='ticker',auto_adjust= True, prepost= True, threads = 6, proxy =None)
[*********************100%***********************]  3 of 3 completed

In [38]: data.head
Out[38]:
<bound method NDFrame.head of                   SPR             ...        AAPL
                 Open       High  ...       Close        Volume
Date                              ...
2020-01-01  73.271088  75.070135  ...  253.687912  3.058574e+09
2020-02-07        NaN        NaN  ...         NaN           NaN
2020-02-19        NaN        NaN  ...         NaN           NaN
2020-03-19        NaN        NaN  ...         NaN           NaN
2020-04-01  22.469999  25.320000  ...  293.160004  9.100395e+08
2020-05-04  19.139999  20.420000  ...  293.160004  3.339199e+07

[6 rows x 15 columns]>

參考學(xué)習(xí)資料:
https://pypi.org/project/yfinance/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末鸠按,一起剝皮案震驚了整個(gè)濱河市礼搁,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌目尖,老刑警劉巖馒吴,帶你破解...
    沈念sama閱讀 216,843評(píng)論 6 502
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異瑟曲,居然都是意外死亡饮戳,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,538評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門洞拨,熙熙樓的掌柜王于貴愁眉苦臉地迎上來扯罐,“玉大人,你說我怎么就攤上這事烦衣〈鹾樱” “怎么了掩浙?”我有些...
    開封第一講書人閱讀 163,187評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)秸歧。 經(jīng)常有香客問我厨姚,道長(zhǎng),這世上最難降的妖魔是什么键菱? 我笑而不...
    開封第一講書人閱讀 58,264評(píng)論 1 292
  • 正文 為了忘掉前任谬墙,我火速辦了婚禮,結(jié)果婚禮上经备,老公的妹妹穿的比我還像新娘拭抬。我一直安慰自己,他們只是感情好侵蒙,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,289評(píng)論 6 390
  • 文/花漫 我一把揭開白布造虎。 她就那樣靜靜地躺著,像睡著了一般蘑志。 火紅的嫁衣襯著肌膚如雪累奈。 梳的紋絲不亂的頭發(fā)上贬派,一...
    開封第一講書人閱讀 51,231評(píng)論 1 299
  • 那天急但,我揣著相機(jī)與錄音,去河邊找鬼搞乏。 笑死波桩,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的请敦。 我是一名探鬼主播镐躲,決...
    沈念sama閱讀 40,116評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼侍筛!你這毒婦竟也來了萤皂?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,945評(píng)論 0 275
  • 序言:老撾萬榮一對(duì)情侶失蹤匣椰,失蹤者是張志新(化名)和其女友劉穎裆熙,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體禽笑,經(jīng)...
    沈念sama閱讀 45,367評(píng)論 1 313
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡入录,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,581評(píng)論 2 333
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了佳镜。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片僚稿。...
    茶點(diǎn)故事閱讀 39,754評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖蟀伸,靈堂內(nèi)的尸體忽然破棺而出蚀同,到底是詐尸還是另有隱情缅刽,我是刑警寧澤,帶...
    沈念sama閱讀 35,458評(píng)論 5 344
  • 正文 年R本政府宣布蠢络,位于F島的核電站拷恨,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏谢肾。R本人自食惡果不足惜腕侄,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,068評(píng)論 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望芦疏。 院中可真熱鬧冕杠,春花似錦、人聲如沸酸茴。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,692評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽薪捍。三九已至笼痹,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間酪穿,已是汗流浹背凳干。 一陣腳步聲響...
    開封第一講書人閱讀 32,842評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留被济,地道東北人救赐。 一個(gè)月前我還...
    沈念sama閱讀 47,797評(píng)論 2 369
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像只磷,于是被迫代替她去往敵國(guó)和親经磅。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,654評(píng)論 2 354