做了一个从网络获取各个股票的基本面数据,然后画图进行对比的小脚本。具体的实现使用了matlab和python,功能是按照申万行业分类对比,并把相应数据按照表格和图片形式生成pdf文件;本期望实现脚本从巨潮下载原始的pdf数据进行分析对比,但发现各个公司的文件格式并不相同,没想到好的方法同义处理,所以只能先从网络获取数据了。主要流程代码:
function selectMain(fileName,typeName,newCatchData,getFinanReport)
if nargin==2
newCatchData = 1;
getFinanReport = '1';
elseif nargin==3
getFinanReport = '1';
end
fprintf('%d\n',newCatchData);
if(1 == newCatchData)
%流程1:抓取网络数据,下载财报文件
%调用python脚本获取网络信息,可以通过设置标志位选择是否需要从巨潮下载财务报告信息
systemCmd = strcat('python selector.py',32,fileName);
%systemCmd = strcat(systemCmd,32);
systemCmd = strcat(systemCmd,32,getFinanReport);
fprintf('%s\n',systemCmd);
%matlab通过system调用系统命令来调用python脚本
system(systemCmd);
end
%rsltFileName = str