249楼 duy3 | 发表于2022-11-02 16:29:48
双色球:
http://data.17500.cn/ssq_asc.txt 更换新网址后“s = Split(.responseText, Chr(10))”不能分割了,请教怎么更改?
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "http://data.17500.cn/ssq_asc.txt", False
.Send
s = Split(.responseText, Chr(10))
End With
251楼 duy3 | 发表于2022-11-07 14:31:34
双色球:
http://data.17500.cn/ssq_asc.txt 更换新网址后“s = Split(.responseText, Chr(10))”不能分割了,请教怎么更改?
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "http://data.17500.cn/ssq_asc.txt", False
.Send
s = Split(.responseText, Chr(10))
End With
不支持 .responseText
不支持 .responseText
255楼 duy3 | 发表于2022-11-07 16:50:37
Dim i%, j%, S() As String, URL1 As String, IE As Object
URL1 = "http://data.17500.cn/ssq_asc.txt" '"http://www.17500.cn/getData/ssq.TXT"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate URL1, False
While IE.ReadyState <> 4 Or IE.Busy = True
DoEvents
Wend
S = Split(IE.document.body.innerText, Chr(10))
List = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
ReDim arr(1 To UBound(S), 1 To 29)
For i = 0 To UBound(S) - 1
For j = 1 To 29
arr(i + 1, j) = Split(S(i), " ")(List(j - 1))
Next j
Next i
With Cells(3, 1).Resize(UBound(S), 29)
.Clear
.Value = arr
End With
这个的缺点就是每次刷新都打开一次网页,还不知道如何阻止网页打开