Python Forum
Error with web.DataReader - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Error with web.DataReader (/thread-3769.html)



Error with web.DataReader - rakhmadiev - Jun-22-2017

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/historical?cid=25683&startdate=Jun+20%2C+2017&enddate=Jun+20%2C+2017&num=30&ei=EuNLWfGzKNWPULejj8gP)

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)



RE: Error with web.DataReader - Larz60+ - Jun-24-2017

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)