如何在sina股票上下载数据
http://money.finance.sina.com.cn/corp/go.php/vFD_FinancialGuideLine/stockid/600228/di...
http://money.finance.sina.com.cn/corp/go.php/vFD_FinancialGuideLine/stockid/600228/displaytype/4.phtml 这个网址某个股“财务分析数据”
有高手写了下载“现金流量表”的代码,如下:(怎么修改,才能下载到财务分析数据呢?)
Sub 下载现金流量表()'使用VBA下载现金流量表并存储
Dim url As String, url1 As String, url2 As String Dim mycode As String '存储股票代码 Dim saveto As String '存储位置 Dim xpost As Object Dim i As Integer url1 = "http://money.finance.sina.com.cn/corp/go.php/vDOWN_CashFlow/displaytype/4/stockid/" url2 = "/ctrl/all.phtml"
t = Timer For i = 2 To Range("A10000").End(xlUp).Row mycode = Range("A" & i).Value url = url1 & mycode & url2 saveto = ThisWorkbook.Path & "\CashFlow" If Dir$(saveto, 16) = "" Then MkDir saveto Set xpost = CreateObject("Microsoft.XMLHTTP") xpost.Open "GET", url, 0 xpost.Send Set sGet = CreateObject("ADODB.Stream") sGet.Mode = 3 sGet.Type = 1 sGet.Open sGet.Write (xpost.responseBody) sGet.SaveToFile saveto & "\" & mycode & ".xls", 2 Range("E" & i).Value = "OK" Range("E1").Value = "正在下载第" & i & "个公司的现金流量表" waitsec (0.1) Next Range("E1").Value = "现金流量表下载完成" MsgBox "共耗时" & Round(Timer - t, 2) & "秒"End Sub
Function waitsec(dS As Double)
Dim sTimer As Date sTimer = Timer Do DoEvents Loop While Format((Timer - sTimer), "0.00") < dSEnd Function 展开
有高手写了下载“现金流量表”的代码,如下:(怎么修改,才能下载到财务分析数据呢?)
Sub 下载现金流量表()'使用VBA下载现金流量表并存储
Dim url As String, url1 As String, url2 As String Dim mycode As String '存储股票代码 Dim saveto As String '存储位置 Dim xpost As Object Dim i As Integer url1 = "http://money.finance.sina.com.cn/corp/go.php/vDOWN_CashFlow/displaytype/4/stockid/" url2 = "/ctrl/all.phtml"
t = Timer For i = 2 To Range("A10000").End(xlUp).Row mycode = Range("A" & i).Value url = url1 & mycode & url2 saveto = ThisWorkbook.Path & "\CashFlow" If Dir$(saveto, 16) = "" Then MkDir saveto Set xpost = CreateObject("Microsoft.XMLHTTP") xpost.Open "GET", url, 0 xpost.Send Set sGet = CreateObject("ADODB.Stream") sGet.Mode = 3 sGet.Type = 1 sGet.Open sGet.Write (xpost.responseBody) sGet.SaveToFile saveto & "\" & mycode & ".xls", 2 Range("E" & i).Value = "OK" Range("E1").Value = "正在下载第" & i & "个公司的现金流量表" waitsec (0.1) Next Range("E1").Value = "现金流量表下载完成" MsgBox "共耗时" & Round(Timer - t, 2) & "秒"End Sub
Function waitsec(dS As Double)
Dim sTimer As Date sTimer = Timer Do DoEvents Loop While Format((Timer - sTimer), "0.00") < dSEnd Function 展开
5个回答
展开全部
配资现在这么多,肯定不违法,受法律保护的,要违法早被查了。change. Finally, the point
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
财务数据不是通过网站生成的,是通过公司会计软件处理生成的,你现在需要的数据直接下载就可以了,不需要修改。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个真不太懂,不如用正式的股票软件,使用方便
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询