一株紫丁香教案,楚乔什么时候恢复记忆,膛线冲子
dim ie
set ie=createobject("internetexplorer.application")
ie.visible=true
ie.navigate "http://www.ln.chinaunicom.com/index.shtml"
while ie.busy or ie.readystate<>4
endwhile
ie.document.all("userid").value= "13304948957"'手机号码
ie.document.all("passwd").value = "111111"'密码
ie.document.all("verifycode").value = "1111"'识别码
ie.document.all.loginonform.submit
一调试脚本就显示 缺少对象:"ie.document.all("....")"
"ie.document.all.loginonform.submit"这行还显示对象不支持此属性或者方法
请各位大侠帮忙看看 哪里出了错 谢谢啦
提问者: fxdca2008 - 试用期 一级
最佳答案
楼主代码有几处错误:
1. endwhile应为wend
2. 网页上的手机号码、密码等表单元域其实是在一个<iframe>中的网页上,不能直接调用,而应该使
用ie.document.frames(0).document.loginonform...来调用
正确代码如下(可以自动填写交提交,提交上去以后会返回“识别码错误”的提示,属于正常现象)
:
sub test()
dim ie
set ie = createobject("internetexplorer.application")
ie.visible = true
ie.navigate "http://www.ln.chinaunicom.com/index.shtml"
while ie.busy or ie.readystate <> 4
wend
ie.document.frames(0).document.loginonform.userid.value = "13304948957" '手机号码
ie.document.frames(0).document.loginonform.passwd.value = "111111" '密码
ie.document.frames(0).document.loginonform.verifycode.value = "1111" '识别码
ie.document.frames(0).document.loginonform.submit
end sub
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
-
-
-
网友评论