我在IE上面已经打开了一个网站(此网站需要用户登录的),并且由于我只需要我打开的这个网页的数据,所以不需要另外再发请求。
我写了一个简单的获取代码。如下面代码。
但是我这个代码 ie.document.body.innerHTML获取到的只是最外层的代码(如下图)。我想要获取的最终目标代码是
customsCargo_gotoPageExit.do
请教一下各位大神我要怎么修改代码才能获取到customsCargo_gotoPageExit.do里面的代码?谢谢
Sub test()
Dim ie As Object
For Each ie In CreateObject("shell.Application").Windows
Do While ie.readystate <> 4 Or ie.busy
DoEvents
Loop
If LCase(TypeName(ie.document)) = "htmldocument" Then
If ie.LocationURL = "http://www.singlewindow.gz.cn/cargodecl21/admin/sys_index.do#" Then
Sheet2.Range("A1") = ie.document.body.innerHTML
Exit For
End If
End If
Next
End Sub