Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Annoying problem with web browser

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Hi all,

(ARGHH) Right, i'm using a WebBrowser contol and using the Navigate
command.
I'm navigating through several web pages automatically picking up the
data
from each web page.

I'm doing the following

WB.Navigate "'do loads of stuff'
WB.Navigate "'do loads of stuff'

Its not navigating on the second, third and so on, times. When i step
through the code it works fine and i can see the webbrowser going to
each
page. I've tried the WB.Refresh after each Navigate but still doesn't
seem
to work. If i have a message box after each navigate it works fine as
I can
also see the correct web page shown. Without the msgbox it doesn't
work
again.

Hopefully it makes some sense.

THANKS for any help!!!!

Mel
 
It works fine when you step through it because you are very slow compared to the PC. The Navigate DOES NOT WAIT for a document to load. It is NOT LIKE INPUT from a file. If you want to wait for the document then try
Code:
wb.navigate strurl
Do While(wb.busy = true)
    DoEvents
Loop
 
This does make sense and its doing half of it right now :)
I'm doing the following after each web page (each navigate):

WB.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER
WB.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DONTPROMPTUSER
CBtxt = Clipboard.GetText

CBtxt should contain the web page which is in the webbrowser shouldn't it? it displays the previous one, I've put in the loop with doevents after the navigate but still get the previous web pages contents.

Thanks again!

Mel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top