如果是一個網頁,易取,我已有如下代碼
Dim i&
If WebBrowser2.Busy = False Then
'' Dim IDoc As HTMLDocument
Set IDoc = WebBrowser2.Document
''' Dim Acollection As IHTMLElementCollection
Set Acollection = IDoc.All.tags("input")
Dim s3 As String
Dim s33 As String
For i = 0 To Acollection.length - 1
s3 = Acollection.Item(i).Type
s33 = Acollection.Item(i).Name
Debug.Print s33
If s33 = "Decision" Then Text10 = Acollection.Item(i).Value
'取名為"Decision" 的input,正是我要找的內容
但如果完整網頁在webbrowser 打開是個杠架,我不懂如何在框架網頁中控制子網頁。
我要取的子網頁,是在原框架網頁中 點擊后打開的,并且是在框架中打開,(像126郵箱一樣),請問我怎么在框架中控制該子網頁??
1取得我要的指定input內容
2能有點擊等操作。
已知條件:
1,子網頁在由框架中點擊打開,在框架中打titlE=“查看資料"是固定的,再打開別的也是這個視窗這個標題 。
2、這個網頁的網址中包含有"Add.aspx?" 可以用以下代碼取得到I
Dim i As Integer
For i = 0 To WebBrowser1.Document.getelementsbytagname("iframe").length - 1
If InStr(WebBrowser1.Document.getelementsbytagname("iframe")(i).src, "Add.aspx?") Then
Text9 = Text4 & WebBrowser1.Document.getelementsbytagname("iframe")(i).src
' WebBrowser2.Navigate Text9.Text
End If
Next
如果有需要可以從源代碼中找到ID,請教一下怎么弄啊。
應該不需要再搞個WebBrowser2.Navigate Text9.Text吧
uj5u.com熱心網友回復:
http://www.2cto.com/kf/201104/87829.htmluj5u.com熱心網友回復:
http://www.2cto.com/kf/201104/87829.html轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/144989.html
標籤:控件
上一篇:vb如何把表單里的值post提交
