ie页面和它的弹出框的关系是什么?我怎么获得已打开的ie页面的弹出框?
是不是要用到mshtml.HTMLDialog?高手指点迷津
我已经获得了frame的内容和body的内容,但是不知道如何获取弹出框内容。
----------------------------------------------------
Try
Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer
Dim Doc As Object
Dim ObjDoc As mshtml.HTMLDocument
'ListBox1.Clear()
'List2.Clear()
'Text1.Text = SWs.count
Dim strlist1 As String = " "
Dim strlist2 As String = " "
Dim i As Integer = 0
Dim j As Integer = 0
Dim k As Integer = 0
Dim flag As Boolean = False
MsgBox( "您要查找的字符是: " & (TextBox1.Text))
For Each IE In SWs
i = i + 1
Doc = IE.Document
If TypeOf Doc Is mshtml.HTMLDocument Then
j = j + 1
ObjDoc = Doc
'MsgBox(ObjDoc.title)
If j = 1 Then
MsgBox(ObjDoc.body.innerHTML)
MsgBox(ObjDoc.frames.length)
For k = 0 To ObjDoc.frames.length - 1
'MsgBox(ObjDoc.frames.item(k).ToString)
Next
flag = ObjDoc.body.innerHTML.Contains(TextBox1.Text)
If flag = True Then
MsgBox( "恭喜!您查找的字符 ' " & (TextBox1.Text) & " '在页面内. " & (TextBox1.Text))
Else
MsgBox( "恭喜!您查找的字符 ' " & (TextBox1.Text) & " '不在页面内. " & (TextBox1.Text))
End If
End If
End If
Next
MsgBox( "-----------共打开 " & (i) & "页面,其中,ie页面有 " & (j) & "个------------- ")
Catch ex As Exception
MsgBox(ex.Message)
End Try
----------------------------------------------------