如何用vb 编程实现模拟点击这个网页上的这个按钮 WebBrowser或intel等的post或模拟点击都可以接受
<FORMname=""action=./dfight.domethod=post><INPUTtype=hiddenvalue=228490206name=id><!-...
<FORM name="" action=./dfight.do method=post><INPUT type=hidden value=228490206 name=id> <!--<input type="hidden" name="from" value="/hitlist.do"/>--><INPUT class=sub_btn type=submit value=攻击 name=id> </FORM>
按照一楼的去做了 可是结果还是没反应 o(∩_∩)o.....请教了<tr> <td><a href="./status.do?userId=*****">jing</a>,39级,<td>430</td>
<td> <form name="" action="./dfight.do" method="post"> <input type="hidden" name="id" value="*****"/>
<!--<input type="hidden" name="from" value="/hitlist.do"/>-->
<input class="sub_btn" type="submit" name="id" value="攻击"/>
</form>
</td>
</tr>
<tr>
<td><a href="./status.do?userId=***">潘菁</a>,39级,</td>
<td>461</td>
<td>
<form name="" action="./dfight.do" method="post">
<input type="hidden" name="id" value="***"/>
<!--<input type="hidden" name="from" value="/hitlist.do"/>-->
</form>
</td>
</tr> 展开
按照一楼的去做了 可是结果还是没反应 o(∩_∩)o.....请教了<tr> <td><a href="./status.do?userId=*****">jing</a>,39级,<td>430</td>
<td> <form name="" action="./dfight.do" method="post"> <input type="hidden" name="id" value="*****"/>
<!--<input type="hidden" name="from" value="/hitlist.do"/>-->
<input class="sub_btn" type="submit" name="id" value="攻击"/>
</form>
</td>
</tr>
<tr>
<td><a href="./status.do?userId=***">潘菁</a>,39级,</td>
<td>461</td>
<td>
<form name="" action="./dfight.do" method="post">
<input type="hidden" name="id" value="***"/>
<!--<input type="hidden" name="from" value="/hitlist.do"/>-->
</form>
</td>
</tr> 展开
展开全部
根据你的反馈,答复如下:
本代码会自动点击攻击按钮的,只不过你要选择时机,即:当你进入攻击页面时,按下执行攻击的VB按钮(如command1),就会作出反应。代码修改如下:
Private Sub Command1_Click() '攻击按钮
Dim Vdoc,i, S As String
On Error Resume Next
For i = 0 To WebBrowser1.Document.All.length - 1
Set Vdoc = WebBrowser1.Document.All(i)
If UCase(Vdoc.tagname) = "INPUT" Then
S = Trim(Vdoc.innertext)
If s="攻击" Then
Vdoc.click
End If
End If
DoEvents
Next
End Sub
本代码会自动点击攻击按钮的,只不过你要选择时机,即:当你进入攻击页面时,按下执行攻击的VB按钮(如command1),就会作出反应。代码修改如下:
Private Sub Command1_Click() '攻击按钮
Dim Vdoc,i, S As String
On Error Resume Next
For i = 0 To WebBrowser1.Document.All.length - 1
Set Vdoc = WebBrowser1.Document.All(i)
If UCase(Vdoc.tagname) = "INPUT" Then
S = Trim(Vdoc.innertext)
If s="攻击" Then
Vdoc.click
End If
End If
DoEvents
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询