Login can';在我的脚本中找不到错误

Login can';在我的脚本中找不到错误,login,vbscript,webpage,Login,Vbscript,Webpage,我有一个小的VBScript,可以打开网页并输入我的登录凭据。然而,我总是遇到错误,不知道如何修复它 Call Main Function Main Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_") IE.Visible = True IE.Navigate "https://x10hosting.com/sso/login" Wait IE With IE.Docu

我有一个小的VBScript,可以打开网页并输入我的登录凭据。然而,我总是遇到错误,不知道如何修复它

Call Main

Function Main
    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Visible = True
    IE.Navigate "https://x10hosting.com/sso/login"
    Wait IE
    With IE.Document
        .getElementByID("identifier").value = "FAKEEMAIL@my.com"
        .getElementByID("password").value = "FAKEPASS"
        .getElementsByName("button button-rounded button-primary")(0).Submit
    End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub
callmain
主要功能
设置IE=WScript.CreateObject(“InternetExplorer.Application”、“IE”)
可见=真实
即“导航”https://x10hosting.com/sso/login"
等等
用IE文件
.getElementByID(“标识符”).value=“FAKEEMAIL@my.com"
.getElementByID(“密码”).value=“FAKEPASS”
.getElementsByName(“按钮圆形按钮主”)(0)。提交
以
端函数
分段等待(IE)
做
WScript.Sleep 500
当IE.ReadyState<4且IE.Busy时循环
端接头
错误是:

line: 11 char: 9 Error: Object required: 'getElementsByName(...)(...)' code: 800A01A8 sources: Microsoft VBScript runtime error 第11行 字符:9 错误:需要对象:“getElementsByName(…)(…)” 代码:800A01A8 来源:Microsoft VBScript运行时错误 这可能是因为您使用的getElementsByName错误吗? getElementsByName查找具有该名称的属性,但似乎使用了类名

您需要使用getElementsByClassName


@AnsgarWiechers请看帖子。我当时编辑过
With IE.Document
    .getElementByID("identifier").value = "FAKEEMAIL@my.com"
    .getElementByID("password").value = "FAKEPASS"
    .getElementsByName("button button-rounded button-primary")(0).Submit
End With