vbs自动填表单 vbs自动填表单分析附源码

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

vbs自动填表单 vbs自动填表单分析附源码

  2021-03-17 我要评论
想了解vbs自动填表单分析附源码的相关内容吗,在本文为您仔细讲解vbs自动填表单的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:vbs,填表,下面大家一起来学习吧。
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

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们