Sinisterly
Click a javascript button issue! PLEASE HELP - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework)
+--- Thread: Click a javascript button issue! PLEASE HELP (/Thread-Click-a-javascript-button-issue-PLEASE-HELP)



Click a javascript button issue! PLEASE HELP - FluffyFriendly - 09-26-2013

Hey guys

A couple of months ago I decided to make a bot and I've been working on one for a while, but there's only one thing remaining and that's the most important one. The site code looks like this:
Code:
<a class="single_like_button btn3-wrap" onclick="openFbLWin_588158();"> <span>&nbsp;</span><div class="btn3">Like</div></a>

And my code looks like this:
Code:
For Each elem As HtmlElement In WebBrowser1.Document.GetElementsByTagName("button") ' Check the attributtes you want If elem.GetAttribute("class") = "single_like_button btn3-wrap" Then 'Check even the text if you want If elem.InnerText = "Like" Then 'Invoke your event elem.InvokeMember("click") End If End If Next
Do you got any ideas on how to click this button?


RE: Click a javascript button issue! PLEASE HELP - SQLi - 10-14-2013

Try this way
Code:
WebBrowser1.Document.Window.DomWindow.execscript("openFbLWin_588158();", "JavaScript")

Also, if you're making a bot, you shouldn't use a webbrowser control for it.