Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2008 Errors working with internet explorer

$
0
0
i have an application that will log into a website and it works on one application. I'm building a job to scrape data off of the website but the code which was working in one application is not working in this one. The last line of code puts the username in the username input field on the website and is causing me problems. The major difference between these two applications is that, on the working application this navigation happens on the UI thread and on the non-working application it happens on another thread outside of the UI thread. What am I doing wrong?

It's interesting to note that if I try to set the value of the username field two seperate ways I get two seperate errors.



Code:

Dim IE As Object = CreateObject("internetexplorer.application")
Dim element As mshtml.IHTMLElement
Dim doc As mshtml.HTMLDocument
dim loginsite as string = "https://secure.myhfs.illinois.gov/revs/revsInquiry.do?command=REVS"
dim username as string = "testuser"

IE.navigate(loginsite)
    Do While IE.readystate <> 4
                        Loop
                        Do : Loop Until IE.busy = False

'at this point i know the website is loaded
doc.frames(1).document.getelementbyid("username").value = username
'Interface 'mshtml.framescollection' cannot be indexed because it has no default property
'i tried this and it throws a specifid cast is not valid error
'IE.document.frames(1).document.getelementbyid("username").value = username


Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>