我尝试自动登录网站的代码。但是它不断抛出
对象与客户端的连接断开
Dim IE
set IE = WScript.CreateObject("InternetExplorer.Application")
IE.Visible = true
Call IE.navigate("http://finrpa:8080/controlroom/")
Do While IE.ReadyState <> 4
WScript.Sleep 10
Loop
IE.Document.all.username-inputEl.Value = "parthiban.nadar@thirdware.com"
IE.Document.all.password-inputEl.Value = "Thirdw@re1"
Call IE.Document.all.gaia_loginform.submit
Set IE = Nothing
答案 0 :(得分:0)
抛出异常的那一行? 我发现脚本至少有一个问题。因为控件名称包含破折号,所以它们应该是字符串。所以,而不是
IE.Document.all.username-inputEl.Value = "parthiban.nadar@thirdware.com"
IE.Document.all.password-inputEl.Value = "Thirdw@re1"
应该是
IE.Document.getElementById("username-inputEl").Value = "parthiban.nadar@thirdware.com"
IE.Document.getElementById("password-inputEl").Value = "Thirdw@re1"