亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vbs自動(dòng)填表單分析附源碼

 更新時(shí)間:2008年06月19日 09:19:34   作者:  
用vbs實(shí)現(xiàn)的自動(dòng)填寫表單的代碼分析,希望大家注意代碼的寫法
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"'手機(jī)號(hào)碼 
ie.document.all("passwd").value = "111111"'密碼 
ie.document.all("verifycode").value = "1111"'識(shí)別碼 
ie.document.all.loginOnForm.submit 

一調(diào)試腳本就顯示 缺少對(duì)象:"ie.document.all("....")" 
"ie.document.all.loginOnForm.submit"這行還顯示對(duì)象不支持此屬性或者方法 
請(qǐng)各位大俠幫忙看看 哪里出了錯(cuò) 謝謝啦
提問(wèn)者: fxdca2008 - 試用期 一級(jí) 
最佳答案
樓主代碼有幾處錯(cuò)誤: 
1. EndWhile應(yīng)為Wend 
2. 網(wǎng)頁(yè)上的手機(jī)號(hào)碼、密碼等表單元域其實(shí)是在一個(gè)<iFrame>中的網(wǎng)頁(yè)上,不能直接調(diào)用,而應(yīng)該使
用ie.document.frames(0).document.loginOnForm...來(lái)調(diào)用 
正確代碼如下(可以自動(dòng)填寫交提交,提交上去以后會(huì)返回“識(shí)別碼錯(cuò)誤”的提示,屬于正常現(xiàn)象)
: 
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" '手機(jī)號(hào)碼 
ie.document.frames(0).document.loginonform.passwd.Value = "111111" '密碼 
ie.document.frames(0).document.loginonform.verifycode.Value = "1111" '識(shí)別碼 
ie.document.frames(0).document.loginonform.submit 
End Sub

相關(guān)文章

最新評(píng)論