标签:nan fun div money statement cti url html dataset
getsheets <- function(symbol,type,file){
pre="http://money.finance.sina.com.cn/corp/go.php/vDOWN_";
mid="/displaytype/4/stockid/";
end="/ctrl/all.phtml";
if(type=="BS"){
url=paste(pre,"BalanceSheet",mid,symbol,end,sep="");
destfile=paste(file,"BS_",symbol,".xls",sep="");
}
if(type=="PS"){
url=paste(pre,"ProfitStatement",mid,symbol,end,sep="");
destfile=paste(file,"PS_",symbol,".xls",sep="");
}
if(type=="CF"){
url=paste(pre,"CashFlow",mid,symbol,end,sep="");
destfile=paste(file,"CF_",symbol,".xls",sep="");
}
download.file(url, destfile);
}
c=c("600550","600192","600152","600644","600885","600151")
for(i in 1:length(c)){
code=c[i]
getsheets(code,"BS","D://dataset//")
}
标签:nan fun div money statement cti url html dataset
原文地址:https://www.cnblogs.com/amosding/p/12376396.html