VB 触发网页按钮方法

来源:百度知道 编辑:UC知道 时间:2024/06/05 07:43:15
<div class="popupwrap" id="pan" style="display:none">
<div class="popup">
<div id="poke_confirm">
<p class="operation">
<input type="hidden" name="id" value="224991407" />
<input type="hidden" id="pokeId" value="" />
<input type="hidden" id="hailId" value="" />
<input type="hidden" name="submit" value="" />
<input type="button" value="确定" class="subbutton" onclick="poke_confirm()" />
<input type="button" value="取消" class="canbutton" onclick="cancel()" />
</div>
<div id="poke_working">请稍候……</div>
<div id="poke_ok"><table><tr&g

web 是webBrowser控件

Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)

Set vDoc = Web.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 = "button" And vTag.Value = "确定" Then '找到确定按钮。
vTag.Select '也可以没有这个
vTag.Click '点击提交了,一切都OK了
End If
End If

Next I

end sub