Home > Software engineering >  VB use webbrowser how framework web page specified in the control value or control the name web page
VB use webbrowser how framework web page specified in the control value or control the name web page

Time:10-31

If it is a web page, easy to take, I have the following code

 
Dim i&
If WebBrowser2. Busy=False Then
"' Dim IDoc As HTMLDocument
Set the IDoc=WebBrowser2. Document
"' Dim Acollection As IHTMLElementCollection



The 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 the
S33=Acollection. Item (I). The Name
The Debug. Print s33

If s33="Decision" Then Text10=Acollection. The Item (I). The Value
'input, called the "Decision" is what I want to find the content of the


But if full page is a bar in webbrowser open frame, I don't know how to control in the framework of web page,

I want to take a child of the web page, the original framework page after click open, and is open, the frame (like 126 mailbox), could you tell me how to control in the framework of the child I page??

1 get I want to specify the input content
2 can click operation, such as

The known conditions:

1, child page click open in by the framework, in the framework of the titlE="view data" is fixed, then open the other is the window titlE,
2, in this web site contains the Add. Aspx? "" Can use the following code has to I


 Dim As Integer I 
For I=0 To WebBrowser1. Document. Getelementsbytagname (" iframe "). The length of 1

If InStr (WebBrowser1. Document. Getelementsbytagname (" iframe ") (I). The SRC, the Add. Aspx? "" ) Then
Text9=Text4 & amp; WebBrowser1. Document. Getelementsbytagname (" iframe ") (I). The SRC



'WebBrowser2. Navigate Text9. Text




End the If
Next





If there is a need can be found from the source code ID, ask how ah,
Should not need to have a WebBrowser2. Navigate Text9. The Text

CodePudding user response:

http://www.2cto.com/kf/201104/87829.html

CodePudding user response:

http://www.2cto.com/kf/201104/87829.html
  • Related