【发布时间】:2011-03-04 00:51:51
【问题描述】:
我正在尝试登录受密码保护的站点。我在 VBScript 中使用 InternetExplorer 对象。错误在于 oIE.readystate 值被读取一次之后 - 也就是说,在我的循环中,它会读取一次 oIE.readystate 值,但在第二次尝试读取 oIE.readystate 值时,我得到一个“800A01CE”运行时错误,提示“远程服务器机器不存在或不可用:'oIE.readystate'”
这段代码在 IE6 中运行良好;我的公司实施了新的广告政策(不知道这会如何/是否会影响这一点),我们现在正在使用 IE7。我不确定 IE7 是否在 oIE.readystate 之后以某种方式阻止了该进程。非常感谢任何建议。
符号:
“-->”表示我正在写关于该特定代码行执行后的进程输出的评论。
set oIe=wscript.createobject("InternetExplorer.Application", "IE_")
oIe.navigate "www.google.com"
do while oIe.readystate<>4
msgbox "oIE readystate: " & oIE.readystate
''#-->gets here one time and outputs "oIE readstate: 0"
wscript.sleep 1000
msgbox "oIE readystate: " & oIE.readystate
''#-->errors out.
loop
msgbox "outside of oIE readystate: " & oIE.readystate
''#--->never gets here.
【问题讨论】:
标签: internet-explorer vbscript readystate