Sub test()
Dim HTML, tb, i&, j&, x&, n&, s$
[a2:d9999] = ""
Set HTML = CreateObject("htmlfile")
With CreateObject("msxml2.xmlhttp")
For x = 0 To 63
.Open "get", "https://gaokao.chsi.com.cn/zzbm/mdgs/detail.action?oid=476733931&lx=1&start=" & 30 * x, False
.Send
Application.Wait (Now + TimeValue("00:00:02"))
HTML.body.innerhtml = .responsetext
Set tb = HTML.ALL.tags("table")(0).Rows
For i = 1 To tb.Length - 1
n = n + 1
For j = 0 To tb(i).Cells.Length - 1
Cells(n + 1, j + 1) = tb(i).Cells(j).innertext
Next
Next
Next
End With
MsgBox "获取完毕!"
End Sub
|