雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

vb

當(dāng)前位置:主頁 > 軟件編程 > vb >

vbs自動填表單分析附源碼

來源:本站原創(chuàng)|時間:2020-01-10|欄目:vb|點擊:

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ī)號碼 
ie.document.all("passwd").value = "111111"'密碼 
ie.document.all("verifycode").value = "1111"'識別碼 
ie.document.all.loginOnForm.submit 

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

欄    目:vb

下一篇:vbs實現(xiàn)計算機(jī)重啟

本文標(biāo)題:vbs自動填表單分析附源碼

本文地址:http://m.jygsgssxh.com/a1/vb/7698.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有