佳木斯湛栽影视文化发展公司

主頁 > 知識(shí)庫 > vbs自動(dòng)填表單分析附源碼

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

熱門標(biāo)簽:網(wǎng)站文章發(fā)布 美圖手機(jī) 鐵路電話系統(tǒng) 智能手機(jī) 檢查注冊(cè)表項(xiàng) 服務(wù)器配置 銀行業(yè)務(wù) 呼叫中心市場(chǎ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ò) 謝謝啦
提問者: fxdca2008 - 試用期 一級(jí) 
最佳答案
樓主代碼有幾處錯(cuò)誤: 
1. EndWhile應(yīng)為Wend 
2. 網(wǎng)頁上的手機(jī)號(hào)碼、密碼等表單元域其實(shí)是在一個(gè)iFrame>中的網(wǎng)頁上,不能直接調(diào)用,而應(yīng)該使
用ie.document.frames(0).document.loginOnForm...來調(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

標(biāo)簽:上海 滄州 樂山 紅河 河南 長(zhǎng)治 沈陽 新疆

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《vbs自動(dòng)填表單分析附源碼》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    镇江市| 平南县| 隆尧县| 都昌县| 讷河市| 木兰县| 陈巴尔虎旗| 铅山县| 隆尧县| 钟山县| 武平县| 永吉县| 名山县| 门头沟区| 瓮安县| 交城县| 东兴市| 五家渠市| 南阳市| 巫山县| 基隆市| 伊金霍洛旗| 陕西省| 当雄县| 白银市| 昌图县| 洛隆县| 页游| 灵丘县| 焉耆| 富宁县| 璧山县| 桓台县| 交城县| 贡嘎县| 宣恩县| 大城县| 于都县| 岗巴县| 廊坊市| 兴安县|