How to fill out the form automatically by vbs
This article will explain in detail how vbs automatically fills out forms. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Dim ie
Set ie=createobject ("internetexplorer.application")
Ie.visible=true
Ie.navigate "http://www.ln.chinaunicom.com/index.shtml"
While ie.busy or ie.readystate4
EndWhile
Ie.document.all ("userid"). Value= "13304948957" Mobile phone number
Ie.document.all ("passwd"). Value = "111111" 'password
Ie.document.all ("verifycode") .value = "1111" 'identification number
Ie.document.all.loginOnForm.submit
As soon as the debug script shows the missing object: "ie.document.all (".... ")"
The line "ie.document.all.loginOnForm.submit" also shows that the object does not support this property or method
Please help me to see what went wrong. Thank you.
Questioner: fxdca2008-probationary level 1
Best answer
There are several errors in the building master code:
1. EndWhile should be Wend
two。 The mobile phone number, password and other form element fields on the web page are actually on a web page, which cannot be called directly, but should be made
Use ie.document.frames (0). Document.loginOnForm... To call
The correct code is as follows (it can be filled in and submitted automatically, and the prompt of "identification code error" will be returned after submission, which is a normal phenomenon)
:
Sub test ()
Dim ie
Set ie = CreateObject ("internetexplorer.application")
Ie.Visible = True
Ie.navigate "http://www.ln.chinaunicom.com/index.shtml"
While ie.busy Or ie.readystate 4
Wend
Ie.document.frames (0). Document.loginonform.UserId.Value = "13304948957" Mobile phone number
Ie.document.frames (0) .document.loginonform.passwd.Value = "111111" 'password
Ie.document.frames (0). Document.loginonform.verifycode.Value = "1111" 'identification code
Ie.document.frames (0). Document.loginonform.submit
End Sub
This is the end of the article on "how to automatically fill out forms in vbs". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.