|
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 22
.Open "get", "http:www、csyyhb.cn/plist.asp?lx=small&anid=18&nid=31&Page=" & 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
麻烦大神帮我看看好吗,我实在不知道该怎么办了。哪里出了问题。编码我也看了,是一样的。中文显示的是带框框的问号~
HTML.body.innerhtml = .responsetext
改成
HTML.body.innerhtml = StrConv(.responseBody, vbUnicode)
|
|