|
我要抓取这个网页http:(增加双//)fz.people.com.cn/skygb/sk/index.php/Index/seach?&p=1
的数据,请问该如何修改下面的代码? ~~~紧急请大神赐教~~~
Option Explicit
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", "http:(增加双//)fz.people.com.cn/skygb/sk/index.php/Index/seach?&p=1
& 20 * 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
MsgBox "获取完毕!"
End Sub
|
|