phpfail
Regular Member
- Aug 21, 2011
- 236
- 107
** RESOLVED ** thanks for the help.
Okay so I've been coding a bot and I've ran into a problem, it's the only thing holding back the completion of my bot. The bot is trying to click a button on a page, but theres more then one button and theres no unique identifier, so all the buttons are the same code, so the bot ends up clicking all the buttons on the page. The only unique identifier is the div id which surrounds each button.
Example
So my question is this, how would I get the bot to click the button within the specified div with the correct ID, here is my code I'm using but it clicks all buttons not the button within the div.
If anyone could help me I'd greatly appreciate it and maybe do something for you in return, I can code php and design very clean and professional websites. Or I can send you some money on paypal when I get paid next week. Thanks in advance for any help
Okay so I've been coding a bot and I've ran into a problem, it's the only thing holding back the completion of my bot. The bot is trying to click a button on a page, but theres more then one button and theres no unique identifier, so all the buttons are the same code, so the bot ends up clicking all the buttons on the page. The only unique identifier is the div id which surrounds each button.
Example
Code:
<div id="93edufjai" name="whatever">
some random code /text
<button type="button">
</div>
So my question is this, how would I get the bot to click the button within the specified div with the correct ID, here is my code I'm using but it clicks all buttons not the button within the div.
Code:
For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
If element.GetAttribute("id") = "93edufjai" Then
For Each ele As HtmlElement In WebBrowser1.Document.GetElementsByTagName("button")
If ele.GetAttribute("type") = "submit" Then
ele.InvokeMember("click")
End If
Next
End If
Next
If anyone could help me I'd greatly appreciate it and maybe do something for you in return, I can code php and design very clean and professional websites. Or I can send you some money on paypal when I get paid next week. Thanks in advance for any help
Last edited: