I'm writing an application to log in to a website, select options and download files. I get this error when I try to select the options and simulate clicking the download button:
WebBrowser b = sender as WebBrowser;
IHTMLDocument2 doc = (IHTMLDocument2)b.Document.DomDocument as IHTMLDocument2;
IHTMLElementCollection collection = doc.all;
foreach (HTMLSelectElement select in collection.tags("select"))
{
list.Add(select);
response = select.innerText;
if (select.innerText.Contains("Select")) // make this more robust
select.selectedIndex = 2;
}
Bookmarks