diff --git a/doc/source/whatsnew/v0.15.1.txt b/doc/source/whatsnew/v0.15.1.txt index f0767b9d66c24..aeef6d6b1c1f1 100644 --- a/doc/source/whatsnew/v0.15.1.txt +++ b/doc/source/whatsnew/v0.15.1.txt @@ -170,7 +170,7 @@ API changes - added Index properties `is_monotonic_increasing` and `is_monotonic_decreasing` (:issue:`8680`). -.. note:: io.data.Options has been fixed for a change in the format of the Yahoo Options page (:issue:`8612`) +.. note:: io.data.Options has been fixed for a change in the format of the Yahoo Options page (:issue:`8612`), (:issue:`8741`) As a result of a change in Yahoo's option page layout, when an expiry date is given, ``Options`` methods now return data for a single expiry date. Previously, methods returned all diff --git a/pandas/io/data.py b/pandas/io/data.py index 8e7474b6e5d1d..490d8998a3148 100644 --- a/pandas/io/data.py +++ b/pandas/io/data.py @@ -698,10 +698,13 @@ def _get_underlying_price(self, url): #Gets the time of the quote, note this is actually the time of the underlying price. try: quote_time_text = root.xpath('.//*[@class="time_rtq Fz-m"]')[0].getchildren()[1].getchildren()[0].text - quote_time = dt.datetime.strptime(quote_time_text, "%I:%M%p EDT") + ##TODO: Enable timezone matching when strptime can match EST with %Z + quote_time_text = quote_time_text.split(' ')[0] + quote_time = dt.datetime.strptime(quote_time_text, "%I:%M%p") + quote_time = quote_time.replace(year=CUR_YEAR, month=CUR_MONTH, day=CUR_DAY) except ValueError: - raise RemoteDataError('Unable to determine time of quote for page %s' % url) + quote_time = np.nan return underlying_price, quote_time diff --git a/pandas/io/tests/data/yahoo_options2.html b/pandas/io/tests/data/yahoo_options2.html index 431e6c5200034..bae9c193e03e1 100644 --- a/pandas/io/tests/data/yahoo_options2.html +++ b/pandas/io/tests/data/yahoo_options2.html @@ -2,7 +2,7 @@
-Mon, Oct 27 2014, 10:14am EDT - U.S. Markets close in 5 hrs 46 mins
Wed, Nov 05 2014, 11:00pm EST - U.S. Markets closed