|
发表于 2022-1-23 12:43:15
|
显示全部楼层
写个例子给你- #include <array.au3>
- $url = "https://www.bankchb.com/frontend/jsp/getG0100_query.jsp"
- $xmlhttp = ObjCreate("msxml2.xmlhttp")
- With $xmlhttp
- .open("GET", $url, False)
- .send
- If .status = 200 Then
- $str = .responsetext
- EndIf
- EndWith
- If $str <> "" Then
- Dim $arr[3] = ["curname", "buy", "sell"]
- $hf = ObjCreate("htmlfile")
- $hf.write("<script></script>")
- With $hf.parentwindow
- .eval("var json=" & $str)
- $n = .eval("json.datas.length")
- If $n > 0 Then
- Dim $result[$n][3]
- For $i = 0 To $n - 1
- For $t = 0 To UBound($arr) - 1
- $result[$i][$t] = .eval("json.datas[" & $i & "]." & $arr[$t])
- Next
- Next
- _ArrayDisplay($result,Default,Default,Default,Default,"curname|buy|sell")
- EndIf
- EndWith
- EndIf
复制代码 |
|