|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub test()
Dim xmlhttp As Object, json As Object
Dim arr(1 To 3)
Set xmlhttp = CreateObject("msxml2.xmlhttp")
Set json = CreateObject("msscriptcontrol.scriptcontrol")
With xmlhttp
.Open "GET", "http://f10.eastmoney.com/PC_HSF10/NewFinanceAnalysis/MainTargetAjax?type=0&code=SZ300059", False
.send
With json
.Language = "jscript"
.addcode "var mydata=" & xmlhttp.responsetext
Set json = .codeobject.mydata
End With
arr(1) = CallByName(CallByName(json, "0", VbGet), "jbmgsy", VbGet)
arr(2) = CallByName(CallByName(json, "0", VbGet), "kfmgsy", VbGet)
arr(3) = CallByName(CallByName(json, "0", VbGet), "zcfzl", VbGet)
End With
[a1].Resize(1, 3) = arr
End Sub
這個網是最簡單的了, 上面都說自己研究下吧 |
评分
-
2
查看全部评分
-
|