Python Forum

Full Version: Error with web.DataReader
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I've found out that for some reason web.DataReader is not working for some of the tickers and I cannot understand why...

For example, when I try to retrieve historical stock prices of Noble Energy (its symbol is 'NBL') web.DataReader fails. However I am able to see all the requered data in Google Finance website (https://www.google.com/finance/historica...WPULejj8gP)

I cannot understand what can cause this problem. Will appreciate your help

import datetime
import pandas_datareader.data as web

start = datetime.datetime(2017, 6, 20)
end = datetime.datetime(2017, 6, 20)

df3 = web.DataReader('NBL', "google", start, end)
This is a valid error.

It is always necessary to post the traceback with any error

your request produces:
Error:
Traceback (most recent call last):  File "<stdin>", line 1, in <module>  File "C:\Python36\lib\site-packages\pandas_datareader\data.py", line 133, in DataReader    session=session).read()  File "C:\Python36\lib\site-packages\pandas_datareader\base.py", line 157, in read    params=self._get_params(self.symbols))  File "C:\Python36\lib\site-packages\pandas_datareader\base.py", line 74, in _read_one_data    out = self._read_url_as_StringIO(url, params=params)  File "C:\Python36\lib\site-packages\pandas_datareader\base.py", line 85, in _read_url_as_StringIO    response = self._get_response(url, params=params)  File "C:\Python36\lib\site-packages\pandas_datareader\base.py", line 120, in _get_response    raise RemoteDataError('Unable to read URL: {0}'.format(url)) pandas_datareader._utils.RemoteDataError: Unable to read URL: http://www.google.com/finance/historical?q=NBL&startdate=Jun+20%2C+2017&enddate=Jun+20%2C+2017&output=csv
If you try to connect to that url, you'll get a 400 status code (URL not found)