I am trying to download the S&P 500 components using python. I can successfully pull single stocks and 'SPX' but I am having problems with the S&P 500 industry groups.
For example: I would like to get the S&P 500 banks index, ticker ^SP500-4010. I see from the url that this should be '%5ESP500-4010' however when I call
import pandas.io.data as web
foo = web.get_data_yahoo('%5ESP500-4010', '2012-12-19', '2013-12-06')
...I get a 404 error. I tried adding an @ symbol, replacing with '^', and other variations but nothing seems to work.
Thanks very much
Unfortunately, these are public tables and no support is offered on them.
I'll leave the post up though in case someone in the community can assist you.
in General Discussion at YDN