I am working with the web browser in C# and I was wondering how can I invoke a click on
How does one invoke a click on a button on a site that has a class name?
For example on some sites they have an ID attached to their buttons so the way in clicking the button would be:
webBrowser1.Document.GetElementById("ID NAME HERE").InvokeMember("click");
…but I need it for a button that uses a class instead of an ID
Ok, I think I get it what you are saying. You have this browser object you are using. OK, try GetElementsByTagName and try all the tags you expect to have the class name, could be p,a,div,span, etc but that’s on you because you are looking for a class name, you could also try using XPath if that supports it, either way you will be getting back a collection of tags, then you must loop through them, check the existence of that class name then “click” it. Otherwise, I’m lost on this one dude.