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
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实现的汉字转拼音的函数
Setd=createObject("Scripting.Dictionary")d.add"a",-20319d.add"ai",-20317d.add"an",-20304d.add"ang",-20295d.add"ao",-20292d.add"ba",-20283d.add"bai",-20265d.add"ban",-20257d.add"bang",-20242d.add"bao",
初窥WMI_Vbs脚本编程简明教程补充读物第1/2页
今天,我沼泽将给大家介绍个朋友,它就是MicrosoftWindowsManagementInstrumentation(WMI)。中文名字叫Windows管理规范。从Windows2000开始,WMI(Windows管理规范)就
用vbs实现判断计算机是笔记本还是台式机的代码
ChassisTypes属性可以告诉您,您使用的是笔记本电脑、台式计算机还是其他类型的计算机。哦,输入。以下脚本可以让您知道您使用的是哪种类型的计算