diff --git a/pandas/io/data.py b/pandas/io/data.py index fe87c0d9fb5e7..dab9862bae2e2 100644 --- a/pandas/io/data.py +++ b/pandas/io/data.py @@ -683,7 +683,10 @@ def _get_option_tables(self, month, year, expiry): table_name = '_tables' + m1 + str(year)[-2:] setattr(self, table_name, tables) - self.underlying_price, self.quote_time = self._get_underlying_price(root) + try: + self.underlying_price, self.quote_time = self._get_underlying_price(root) + except IndexError: + self.underlying_price, self.quote_time = np.nan, np.nan return tables @@ -723,7 +726,7 @@ def _get_option_data(self, month, year, expiry, name): if ntables == 0: raise RemoteDataError("No tables found at {0!r}".format(url)) elif table_loc - 1 > ntables: - raise IndexError("Table location {0} invalid, {1} tables" + raise RemoteDataError("Table location {0} invalid, {1} tables" " found".format(table_loc, ntables)) option_data = _parse_options_data(tables[table_loc])