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

VS 2008 struggling with error handling when a website does not load

$
0
0
My application is navigating an IE window to a website.

Code:

      IE.navigate("https://secure.myhfs.illinois.gov/revs/revsInquiry.do?command=REVS")

        Do : Loop Until tab3.readystate = 4
        Do : Loop Until tab3.busy = False

'what code can I add here to determine if the website is down or not?
'the screen is displaying the web


what happens is that, after navigating to the website and having it display "the website cannot display the page" the readystate and busy loops just spin forever.

I tried this but It wouldn't work because it never got past the readystate loops.
Code:

For Each element In IE.document.all
            If InStr(element.innerText, "The website cannot display the page") Then
              'do whatever i want it to do if the website is down
            End If
Next

Does anyone have anything they use to handle when a website goes down?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



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