Page refresh after few seconds with entering username and password

≡放荡痞女 提交于 2019-12-13 03:57:26

问题


I need a vbscript which should open a page in IE, enter username and password, then keep on refreshing the page after few seconds. I have no idea of vbscript, but here is what I found after searching, it keeps on refreshing the page. doesnt seem to work, keeps on giving me error, object required. The username and password does have a value, I have just omitted it here. The error just comes up before the username could be entered.

Call Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "URL"
  Wait IE
  With IE.Document
    .getElementsByName("LoginName")(0).value = ""
    .getElementsByName("Password")(0).value = ""
    .getElementsByTagName("a")(0).click
  End With
End Function

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

Below is the error

来源:https://stackoverflow.com/questions/19496148/page-refresh-after-few-seconds-with-entering-username-and-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!