I'm trying to teach myself C# the program I'm working on has a browser attached to it. I have been trying to figure out how to make it click a button by the tag name but I cant seem to get it to. I have searched this site and found many helpful topics but none yet to help solve this one.
<a class="some_class" style="letter-spacing: -1px" href="/someurl" data-executing="0">displaybuttontext</a>
That is my button I would like to make the program click. But cant get it to. Here are a few ways I have tried:
private void test1_CheckedChanged_1(object sender, EventArgs e)
{
web.Document.GetElementsByTagName("class").GetAttribute("href").invokemember("click");
}
That method didn't it threw up a error with GetAttribute, I then tried:
moco.Document.GetElementById("a").InvokeMember("click");
This doesn't show an error but also doesn't click the button (displaybuttontext). Could someone be kind enough to show a example and explain it. Keep in mind that I'm new to this.