READYSTATE on WebBrowser Control

Hi all,

I'm navigating a Webbrowser control and I'm checking for the READYSTATE using:

Do While WebBrowser1.ReadyState < 4
    DoEvents
Loop

The problem is that it's been running at 3 for over a half hour now.

I ran this in work on a Win 98 machine with a proxy server Internet connection and had no problems.

Now I'm at home using Win XP Professional through a cable modem Internet connection.

I removed all firewalls and I have no problems surfing the net.

Any ideas?

Thanks

RichW
LVL 4
RichWAsked:
Who is Participating?
 
Richie_SimonettiIT OperationsCommented:
If you need to wait until page is downloaded, don't use that code. It wastes resources.
In documentcomplete event of webbrowser use code like this:
if (pdisp is webbrowser1.object) then
   ' do your stuff here
end if
0
 
RichWAuthor Commented:
Richie, the DocumentComplete event does fire off, but the READYSTATE still stays at 3.  I have already tried it.

I'm trying to capture the HTML of the page with
WebBrowser1.Document.body.innerhtml into a String variable.

Thanks anyway.
RichW

0
 
Richie_SimonettiIT OperationsCommented:
Strange. DocumentComplete fires for every frame that page could has, due to that i added a condition in my previous post.
By the way, if you need ALL contents of page use:
WebBrowser1.Document.documentelement.innerhtml
into a String variable
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Richie_SimonettiIT OperationsCommented:
I have been working with documentcomplete event all the time with no problem. I did never check for READYSTATE.
0
 
rovermCommented:
If you just want the HTML to capture, why don't you use the Inetcontrol ? Way faster! And: an event when the document state changes (12 steps, AFAIK).

If you want this I can provide you with an complete example.
You can also use this method when you have to send parameters to the http server (POST and GET).

D'Mzzl!
RoverM
0
 
RichWAuthor Commented:
Thanks, Richie.  I don't know why, but yesterday your suggestion didn't work, and today it does.

Thanks roverm too.

RichW
0
 
rovermCommented:
Richie is always that lucky with his coding.... LOL Just kidding Richie!

D'Mzzl!
RoverM
0
 
Richie_SimonettiIT OperationsCommented:
That was because your comment was late...
:D
Thanks for "A" grade Rich.
0
 
RichWAuthor Commented:
Thanks for the A answer dude.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.