0
雅虎财经最近将其历史数据网址从http更改为https。例如,下面是获得IBM的最大历史URL(截至今日,2017年5月29日):R:从雅虎财经下载历史数据
https://query1.finance.yahoo.com/v7/finance/download/IBM?period1=-252345600&period2=1496041200&interval=1d&events=history&crumb=jIIyoewBT2o
当我尝试从内部RI阅读资源得到如下:
> url = 'https://query1.finance.yahoo.com/v7/finance/download/IBM?period1=-252345600&period2=1496041200&interval=1d&events=history&crumb=jIIyoewBT2o'
> read.csv(url)
Error in file(file, "rt") :
(converted from warning) cannot open URL 'https://query1.finance.yahoo.com/v7/finance/download/IBM?period1=-252345600&period2=1496041200&interval=1d&events=history&crumb=jIIyoewBT2o': HTTP status was '401 Unauthorized'
当通过浏览器手动调用时,下载工作正常,所以它不像Yahoo Finance试图阻止访问数据。很显然,浏览器正在向雅虎服务器发送一些秘密的内容。我可以通过R脚本发送相同的秘密酱汁吗?
检查[此](https://stackoverflow.com/questions/44083891/started-to-get-error-while-downloading-data-from-yahoo-finance-using-r/)。 – Eldioo
请参阅此链接:https://stackoverflow.com/questions/44015838/cant-download-data-from-yahoo-finance-using-quantmod-in-r?noredirect=1&lq=1 – Dave2e