这是按钮元素:
<input type="image" class="btnClaim" src="http://cdn1.swagbucks.com/content/results/images/btnClaimPrize.png" onclick="sb_vd.capSubmit();">
我已尝试过此代码:
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
For Each element As HtmlElement In allelements
If element.GetAttribute("class") = "btnClaim" Then
element.InvokeMember("click")
但它没有点击按钮。如何以编程方式单击此按钮?
答案 0 :(得分:0)
可以使用javascript
window.onload=function()
{
img_click();
}
function img_click()
{
//do the code
}