首页 > 解决方案 > 在 VBscript 中使用 GetElementByName 时需要对象

问题描述

我使用以下代码,但在我的 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

标签: loginvbscriptwebpage

解决方案


推荐阅读