-
August 2nd, 2010, 03:41 PM
#1
An error has occured in the script on this page
line: 95
char: 10
error: Object required
code: 0
url: [ some url ]
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;
}
response = b.DocumentText;
//<input onclick="JavaScript:validateData('Download')" id="idlnkdownload" type="submit" value="Download" name="download" /></td>
b.Document.GetElementById("download").InvokeMember("click");
any insight?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|