http://zxczxczxc.web-45.com/这是示范网页,我想自动提交,但怎么也不行
Option Explicit
Dim logFlag As Boolean
Dim sCount As Integer
Dim webFlag As Boolean Private Sub cmdLogin_Click()
webFlag = False
WB.Navigate "http://zxczxczxc.web-45.com/"
Do While Not webFlag
DoEvents
Loop
webFlag = False
Dim oDoc As HTMLDocument
Dim oElement As Object
Set oDoc = WB.Document
Set oElement = oDoc.getElementById("title")
oElement.Value = txtID.Text
Set oElement = oDoc.getElementById("content")
oElement.Value = txtPass.Text
WB.Document.oDoc.getElementById("input")("submit3").Click
end sub
...我不是很明白,提交按钮是怎么去判断的,,它的名字就是submit3了..
还有一些代码(48).click或者是(i).click,()里面的数字到底代表什么阿?
例如下面的代码
Set vtag = WebBrowser1.Document.getElementsByTagName("a")
vCount = vtag.length
For i = 0 To vCount - 1
If vtag(i).innerText = "新建" Then
WebBrowser1.Document.All.tags("a")(i).Click
Exit For
End If
我不是很明白,请大人用通俗易懂的话解释下
Option Explicit
Dim logFlag As Boolean
Dim sCount As Integer
Dim webFlag As Boolean Private Sub cmdLogin_Click()
webFlag = False
WB.Navigate "http://zxczxczxc.web-45.com/"
Do While Not webFlag
DoEvents
Loop
webFlag = False
Dim oDoc As HTMLDocument
Dim oElement As Object
Set oDoc = WB.Document
Set oElement = oDoc.getElementById("title")
oElement.Value = txtID.Text
Set oElement = oDoc.getElementById("content")
oElement.Value = txtPass.Text
WB.Document.oDoc.getElementById("input")("submit3").Click
end sub
...我不是很明白,提交按钮是怎么去判断的,,它的名字就是submit3了..
还有一些代码(48).click或者是(i).click,()里面的数字到底代表什么阿?
例如下面的代码
Set vtag = WebBrowser1.Document.getElementsByTagName("a")
vCount = vtag.length
For i = 0 To vCount - 1
If vtag(i).innerText = "新建" Then
WebBrowser1.Document.All.tags("a")(i).Click
Exit For
End If
我不是很明白,请大人用通俗易懂的话解释下