pandas_datareader._utils.RemoteDataError
mrhouzlane opened this issue · comments
Mehdi commented
Code :
import pandas as pd
import pandas_datareader.data as web
FB = web.YahooOptions('FB')
for exp in FB.expiry_dates:
print(exp.isoformat())
I installed pandas-datareader.
Error :
pandas_datareader._utils.RemoteDataError: Unable to read URL: https://query1.finance.yahoo.com/v7/finance/options/FB
Victor Pinheiro commented
Hello,
I had the same problem. Apparently, the API is refusing requests without headers.
My workaround was to add the headers directly to the object.
Also, the ticket FB is returning blank because it got change to 'META'
FB = web.YahooOptions('META')
FB.headers = {'User-Agent': 'Firefox'}
for exp in FB.expiry_dates:
print(exp.isoformat())
It would be nice to have a default header for that request IMO.
Hope it helps :)