vbs如何自动填表单

发布时间:2021-10-13 15:11:41 作者:小新
来源:亿速云 阅读:122

这篇文章将为大家详细讲解有关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

关于“vbs如何自动填表单”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. netty填坑----论填坑,我是专业的
  2. Proxmox虚拟机自动备份填坑记

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

vbs

上一篇:Sql Server存储过程中如何调用存储过程接收输出参数返回值

下一篇:如何使用vue3+typescript实现文件上传

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》