I use IE to open a page, for example, now I want to call VBS script automatically control the form to fill in or click, and so on, how can such a VBS script writing, thank you for your generous help ~!
CodePudding user response:
'reference ieframe. DLL
Private Sub Command1_Click ()
Dim w
Dim s As New SHDocVw. ShellWindows
For Each w In s
If InStr (w. ocationURL, "baidu.com") & gt; 0 Then
W.N avigate (" www.google.cn ")
End the If
Next
End Sub
Look at the code, don't know how to call ieframe. Vb DLL, and then you can control,
CodePudding user response:
Thank you for your help, VBS control pop-up window form, what kind ofCodePudding user response:
VBS can be done, a simple demo again the followingSpecific code needs to be modified according to the requirements of your
Ie. Document. Formlogin. Username. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Password. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Submit
These three lines is to fill out the form and click on the button, I this is to simulate login router
Dim ie set ie=createobject (" internetexplorer. Application ")
Ie. Visible=true on ie. Navigate "http://192.168.1.1"
While Internet explorer. Busy or ie. Readystate<> 4
Wend
Ie. Document. Formlogin. Username. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Password. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Submit