下载CSV文件,不带R中的链接

下载CSV文件,不带R中的链接,r,csv,R,Csv,我想下载csv文件,除了在R中提到的“下载所有记录”之外 url如果您试图获取财务数据,请尝试按照以下步骤操作 #Install Packages library(quantmod) library(plyr) ##set the default source to your function setDefaults(getSymbols, src='google') ##Choosing the argu,ents ##You must find the symbol in yaho

我想下载csv文件,除了在R中提到的“下载所有记录”之外


url如果您试图获取财务数据,请尝试按照以下步骤操作

#Install Packages
library(quantmod)
library(plyr)


##set the default source to your function
setDefaults(getSymbols, src='google')


##Choosing the argu,ents

##You must find the symbol in yahoo finance website
symbol <- "AAPL"


##Start Date
StartDate = as.Date("2018-01-31") 

##End Date
EndDate = as.Date("2018-03-15")

##Getting your stock price
StockData <- getSymbols(symbol, from=StartDate, to=EndDate, auto.assign=F)


##After obtain the data, you can make some adjusts
colnames(StockData) <- c("Open", "High", "Low", "Close","Volume")
#安装软件包
图书馆(quantmod)
图书馆(plyr)
##将默认源设置为您的函数
setDefaults(getSymbols,src='google')
##选择argu,ents
##你必须在雅虎财经网站上找到这个符号

我很困惑。URL未链接到CSV文件。这是关于抓取数据的吗?当你转到url时,有一个Excel图标(靠近右上角)。如果我们点击它,就会下载一个csv文件。我需要下载这个文件。我知道没有与csv的直接链接,因此存在问题。这里的方法是使用RSelenium。我不确定,但谷歌金融的这一功能是否被低估了。我不想在将来失去依赖关系,因此希望直接从网页解析。
#Install Packages
library(quantmod)
library(plyr)


##set the default source to your function
setDefaults(getSymbols, src='google')


##Choosing the argu,ents

##You must find the symbol in yahoo finance website
symbol <- "AAPL"


##Start Date
StartDate = as.Date("2018-01-31") 

##End Date
EndDate = as.Date("2018-03-15")

##Getting your stock price
StockData <- getSymbols(symbol, from=StartDate, to=EndDate, auto.assign=F)


##After obtain the data, you can make some adjusts
colnames(StockData) <- c("Open", "High", "Low", "Close","Volume")