VB总是不能自动点击 网页的submit 愁死我了 求求老师指点
网页代码 :<form name="form1" method="post" action="/login.jsp">
<tr>
<td width="35%" height="25" align="right">用户名:</td>
<td width="65%"><input name="txtUserID" type="text" size="13" maxlength="30" style="border:1 solid #0000000"></td>
</tr>
<tr>
<td height="22" align="right">密码:</td>
<td> <input name="txtPass" type="password" size="13" maxlength="30"style="border:1 solid #0000000"></td>
</tr>
<tr>
<td height="22"> </td>
<td><input type="submit" name="Submit" onSubmit="javascript:return checkit(this.form)" value="登 录" class="stdBtn"></td>
</tr>
VB 代码 :
Sub qiandao()
On Error Resume Next
Dim vDoc, vTag
Dim i As Integer
Set vDoc = WebBrowser1.Document
For i = 0 To vDoc.All.Length - 1 '检测所有标签
If UCase(vDoc.All(i).tagName) = "INPUT" Then '找到input标签
Set vTag = vDoc.All(i)
If vTag.Type = "text" Then
vTag.Value = "123456" '这个是输入到用户名中得值
End If
If vTag.Type = "password" Then
vTag.Value = "111222333" '这个是输入到密码框中的值
End If
If vTag.Type = "submit" Then
vTag.Click
End If End If
Next i
End Sub
不知道为什么 VB愁死我了
Private Sub Form_Load()
WebBrowser1.Navigate "http://e9china.tk/"
End Sub
求求老师指点啊
--------------------编程问答-------------------- vTag.Click
不点击啊 --------------------编程问答-------------------- 把
On Error Resume Next
注释了
然后直接运行,看看出错的位置和提示 --------------------编程问答-------------------- If vTag.Type = "submit" Then
vTag.Click
此处不执行啊 --------------------编程问答-------------------- webbrowser1.navigate "javascript:return checkit(this.form)"
补充:VB , 基础类