Document.body.innertext
程序:Option Explicit
Dim i1 As Integer
Dim Num(128) As Long, Num0(128) As String
Dim m0(128)
Dim objIE As Object
Dim MVs As New ShellWindows
Private Sub Form_Load()
Dim r As Long
Dim r0
On Error Resume Next
Me.Visible = False
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim lSnapShot As Long
Dim lNextProcess As Long
Dim tPE As PROCESSENTRY32
On Error Resume Next
Timer1.Enabled = False
For i1 = 0 To 127
Num0(i1) = " ": Num(i1) = 0
Next i1
i1 = 0
For Each objIE In MVs
If InStr(1, objIE.FullName, "IEXPLORE.EXE ", vbTextCompare) <> 0 Then
If Mid(objIE.LocationURL, 1, 7) = "http:// " Then
Num0(i1) = objIE.LocationURL
Num(i1) = objIE.hwnd
m0(i1) = Len(objIE.Document.body.innertext)
i1 = i1 + 1
End If
End If
Next
Timer1.Enabled = True
End Sub
上面程序就是读出IE的地址栏的URL,和测试网页内容的上度。但是在程序运过程中,对一般的网站有效,对论坛怎么没效果??? 江湖告急!!!
[解决办法]
objIE.Document.body.innertext ==>
objIE.Document.body.innerHTML