Solved

READYSTATE on WebBrowser Control

Posted on 2002-05-17
9
642 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:RichW
  • 4
  • 3
  • 2
9 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 7017909
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
 
LVL 4

Author Comment

by:RichW
ID: 7018172
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7018471
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7018473
I have been working with documentcomplete event all the time with no problem. I did never check for READYSTATE.
0
 
LVL 12

Expert Comment

by:roverm
ID: 7018735
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
 
LVL 4

Author Comment

by:RichW
ID: 7020251
Thanks, Richie.  I don't know why, but yesterday your suggestion didn't work, and today it does.

Thanks roverm too.

RichW
0
 
LVL 12

Expert Comment

by:roverm
ID: 7020275
Richie is always that lucky with his coding.... LOL Just kidding Richie!

D'Mzzl!
RoverM
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7020735
That was because your comment was late...
:D
Thanks for "A" grade Rich.
0
 
LVL 4

Author Comment

by:RichW
ID: 7021248
Thanks for the A answer dude.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now