在VBscript中使用GetElementByName时需要的对象

时间:2019-01-29 16:49:40

标签: login vbscript webpage

我正在使用以下代码,但在我的getelementbyname字段上获取了必需的对象。有人知道这是怎么回事吗? 我尝试了很多变化:

WScript.Quit Main
Call Main
Function Main
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "myurlsamle"
WScript.Sleep 8000
With IE
.document.getElementsByName("UsernameTextBox").value = "myusername"
.document.getElementsByName("PasswordTextBox").value = "mypassword"

End With
End Function

0 个答案:

没有答案