Hey i am trying to make a browser game bot, but i can't seem to get the program to click a "link" with getelementbyid :/ is should happen when i click a button.
here is the code:
private void button1_Click(object sender, EventArgs e)
{
var flyplass = webBrowser1.Document.GetElementById("flyplass");
webBrowser1.Document.GetElementById("flyplass");
flyplass.InvokeMember("Click");
}
C# webrowser act on button click with getelementbyid
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted May 22, 2014, 11:40 AM EDT
Try using "onclick" rather than "Click" as that's the actual name of the DOM event.
BTW, you can delete the second line as it's redundant.