国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

vbs自動填表單分析附源碼

2020-07-26 11:56:57
字體:
來源:轉載
供稿:網友
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
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 教育| 南阳市| 乐至县| 苍梧县| 浏阳市| 德阳市| 渝北区| 通许县| 镇巴县| 库伦旗| 静安区| 连州市| 尖扎县| 章丘市| 英德市| 赣榆县| 淮安市| 延安市| 镇康县| 荥阳市| 阿拉善左旗| 竹北市| 筠连县| 巢湖市| 津市市| 都昌县| 博湖县| 四子王旗| 商南县| 彰化县| 贵州省| 大庆市| 象州县| 齐河县| 闽清县| 腾冲县| 赤城县| 长垣县| 长垣县| 红安县| 青川县|