I am making a bot which has a WebBrowser control which loads some pages. There is a checkbox that I want to be unchecked by my bot. Right now I am using this code:
HtmlElementCollection elc = this.BotBrowser.Document.GetElementsByTagName("input");
foreach (HtmlElement el in elc)
{
if (el.GetAttribute("value").Equals("Leishmania mexicana")) //to uncheck Leishmania mexicana checkbox
{
el.InvokeMember("click");
}
}
But this seems not perfect because it sometimes re-checks the checkbox as this bot has to load pages and perform the task more than 100 times.
Here is the HTML tag of the checkbox:
<input type="checkbox" class="jstree-real-checkbox" id="array(BlastDatabaseOrganism)" name="array(BlastDatabaseOrganism)" value="Leishmania mexicana" checked="checked">
Is there any way I can remove this attribute or set its checked attribute to null?
Try this