diff --git a/pandas_datareader/data.py b/pandas_datareader/data.py index ea635e85..252796d8 100644 --- a/pandas_datareader/data.py +++ b/pandas_datareader/data.py @@ -701,9 +701,6 @@ def _option_frames_from_url(self, url): calls = frames[self._TABLE_LOC['calls']] puts = frames[self._TABLE_LOC['puts']] - if len(calls) == 0 or len(puts) == 0: - raise RemoteDataError('Received no data from Yahoo at url: %s' % url) - calls = self._process_data(calls, 'call') puts = self._process_data(puts, 'put') diff --git a/pandas_datareader/tests/data/yahoo_options3.html b/pandas_datareader/tests/data/yahoo_options3.html new file mode 100644 index 00000000..6e79bb9b --- /dev/null +++ b/pandas_datareader/tests/data/yahoo_options3.html @@ -0,0 +1,2807 @@ + + + + + SPWR Option Chain | Yahoo! Inc. Stock - Yahoo! Finance + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
  • FirefoxInstall the new Firefox »
  • +
    + + +
    + +
    + +
    + + + + + + + +
    + + +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + Dow + + + + Down + + + 0.58% + + + + + + + Nasdaq + + + + Down + + + 0.32% + + + + + + +
    + +
    +
    +
    + + +
    + +
    +

    More on SPWR

    +
    +
    + + +

    Quotes

    + + +

    Charts

    + + +

    News & Info

    + + +

    Company

    + + +

    Analyst Coverage

    + + +

    Ownership

    + + +

    Financials

    + + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + + +
    +
    +
    +
    +
    +
    +

    SunPower Corporation (SPWR)

    + +
    +
    +
    +
    + + 33.05 + + + + + Up +0.07(0.21%) + + + NASDAQ - As of 4:00PM EDT + +
    +
    | + + After Hours: + 33.10 Up +0.05 (0.15%) 7:47PM EDT + + +
    +
    + +
    + + +
    +
    +
    +
    +
    + + +
    + + + +
    + + +
    +
    + +
    +
    May 1, 2015
    + +
    + + + +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + In The Money +
    +
    + + + +
    +
    +

    Show Me Strikes From

    +
    + $ + to $ +
    + Apply Filter + Clear Filter +
    + + + + + +
    + +
    +
    +

    Show Me Strikes From

    +
    + $ + to $ +
    + Apply Filter + Clear Filter +
    + + + + + +
    + + +
    +
    + + + +
    + + +
    + +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/pandas_datareader/tests/test_data.py b/pandas_datareader/tests/test_data.py index ecf99436..b8a7afc1 100644 --- a/pandas_datareader/tests/test_data.py +++ b/pandas_datareader/tests/test_data.py @@ -280,6 +280,7 @@ def setUpClass(cls): cls.dirpath = tm.get_data_path() cls.html1 = os.path.join(cls.dirpath, 'yahoo_options1.html') cls.html2 = os.path.join(cls.dirpath, 'yahoo_options2.html') + cls.html3 = os.path.join(cls.dirpath, 'yahoo_options3.html') #Empty table GH#22 cls.data1 = cls.aapl._option_frames_from_url(cls.html1)['puts'] @classmethod @@ -398,6 +399,11 @@ def test_month_year(self): self.assertTrue(len(data) > 1) + def test_empty_table(self): + #GH22 + empty = self.aapl._option_frames_from_url(self.html3)['puts'] + self.assertTrue(len(empty) == 0) + class TestOptionsWarnings(tm.TestCase): @classmethod @@ -410,7 +416,7 @@ def tearDownClass(cls): def test_options_source_warning(self): if not assert_produces_warning: - raise SkipTest("old version of pandas without " + raise nose.SkipTest("old version of pandas without " "compat.assert_produces_warning") with assert_produces_warning(): aapl = web.Options('aapl')