我在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
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/46904.html
標籤:網絡編程
