Excel 怎么获取这个网址的行情数据
1个回答
展开全部
Sub t()
Dim http, js, url
url = "http://quote.tool.hexun.com/hqzx/quote.aspx?type=2&market=0&sorttype=3&updown=up&page=1&count=5000&time=174900"
Set http = CreateObject("msxml2.xmlhttp")
Set js = CreateObject("scriptcontrol")
js.Language = "jscript"
http.Open "get", url, False
http.send
s = Split(http.responsetext, ";")(0)
js.addcode (s)
Set a = js.codeobject.dataArr
For i = 0 To js.eval("dataArr.length") - 1
Cells(i + 2, 1) = i + 1
For j = 0 To 9
Cells(i + 2, j + 2).NumberFormatLocal = "@"
Cells(i + 2, j + 2) = CallByName(CallByName(a, i, VbGet), j, VbGet)
Next
Next
End Sub
Dim http, js, url
url = "http://quote.tool.hexun.com/hqzx/quote.aspx?type=2&market=0&sorttype=3&updown=up&page=1&count=5000&time=174900"
Set http = CreateObject("msxml2.xmlhttp")
Set js = CreateObject("scriptcontrol")
js.Language = "jscript"
http.Open "get", url, False
http.send
s = Split(http.responsetext, ";")(0)
js.addcode (s)
Set a = js.codeobject.dataArr
For i = 0 To js.eval("dataArr.length") - 1
Cells(i + 2, 1) = i + 1
For j = 0 To 9
Cells(i + 2, j + 2).NumberFormatLocal = "@"
Cells(i + 2, j + 2) = CallByName(CallByName(a, i, VbGet), j, VbGet)
Next
Next
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询