Question browser automatic click

mitza505

New member
Joined
Aug 14, 2013
Messages
2
Programming Experience
Beginner
hi. i use visual basic 2010. I want create a bot for one website but i have one problem.
I don't know ho to do a automatic click. this is the details of button
<div class="btn3">Like</div> i use Microsoft Browser
 
The WebBrowser's document has a collection of HtmlElements. With HtmlElements, you're able to call the InvokeMember method. The issue that you may have is finding the HtmlElement, because the only ways to search for elements from the HtmlDocument are: GetElementByID, GetElementFromPoint, and GetElementByTagName.

What you may wind up doing is getting the Parent Element, and then iterating through the Parent's element collection, checking to see if the element's class is "btn3".
 
i try with this but don't work :(
Private Sub LikeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LikeToolStripMenuItem.Click


For Each Element As HtmlElement In AxWebBrowser1.Document.GetElementsByTagName("inpunt")
If Element.InnerHtml.Contains("class=""btn3""") Then
Element.InvokeMember("click")
Exit For
End If
Next Element
End Sub
 
I'm glad to see that you've tried something, however please list anything associated with what you've posted. For example, did your code give you any errors, did it not do anything at all, did your monitor get ejected into outer space? Also, I noticed that your WebBrowser has Ax in it's name. Is this WebBrowser the default WebBrowser that's provided, or is it the Active X WebBrowser?
 
Back
Top