登录表单提交按钮不起作用。显示错误失败

时间:2020-02-27 06:35:35

标签: vbscript

  WScript.Quit Main

  Function Main
    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Visible = True
    IE.Navigate "http://usvirsplunk2.corp.riotinto.org:8080/controlroom/"
    Wait IE
    With IE.Document
    WScript.Sleep 2000
    .getElementByID("username-inputEl").value = "myusername"
    WScript.Sleep 2000
    .getElementByID("password-inputEl").value = "password"
    WScript.Sleep 2000
    .getElementByID("loginButton").submit
  End With
  End Function

Sub Wait(IE)
  Do
    WScript.Sleep 5000
  Loop While IE.ReadyState < 4 And IE.Busy 
  Do
    WScript.Sleep 5000
  Loop While IE.ReadyState < 4 And IE.Busy 
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub

VBscript能够在登录表单网站中填写用户名和密码。但是在Submit期间,它显示错误(对象不支持此属性或方法.. getelementbyID().. submit。) 请帮忙!

0 个答案:

没有答案