url navigation in a while loop doesnt work

  • Thread starter Thread starter Danny
  • Start date Start date
D

Danny

i am trying to load different pages and scanning some words out of the pages.
But my problem is that the readystate is never 4 except when i show a msgbox

example:

axWebbrowser.Navigate(sUrlPart1+ sUrl)

while axWebbrowser.Readystate <> SHDocVm.tagReEADYSTATE_COMPLETE
iReadystate = axWebbrowser.Readystate
end while
' this example will keep looping becuase Readystate stays 1

But when i do this:
axWebbrowser.Navigate(sUrlPart1+ sUrl)

while axWebbrowser.Readystate <> SHDocVm.tagReEADYSTATE_COMPLETE
MsgBox(axWebbrowser.Readystate)
iReadystate = axWebbrowser.Readystate
end while

The program works only problem are the msgbox popups.
I tried also to put a thread.sleep(10000) in the loop but did doesnt work either.
So whats going on here?
And how do i solve this?
 
* (e-mail address removed) (Danny) scripsit:
i am trying to load different pages and scanning some words out of the pages.
But my problem is that the readystate is never 4 except when i show a msgbox

example:

axWebbrowser.Navigate(sUrlPart1+ sUrl)

Use 'Navigate2' instead and add your other code to the webbrowser's
'DocumentComplete' event.
 
Sorry didnt work,
iReadystate is still 1 and doesnt change.
 
Danny,

Maybe this helps you,
\\\ eDocuments is an arraylist
Private Sub AxWebBrowser1_DocumentComplete(ByVal sender _
As System.Object, _ ByVal e As
AxSHDocVw.DWebBrowserEvents2 _ DocumentCompleteEvent) _
Handles AxWebBrowser1.DocumentComplete
Dim wb As SHDocVw.WebBrowser = _
DirectCast(e.pDisp, SHDocVw.WebBrowser)
eDocuments.Add(wb.Document)
End Sub

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

nuther WebBrowser Q 1
loading a url using mshtml 2
2003 Macro not working in 2007 1
webbroser close page 1
Why is this code not working ? 3
XMLHTTP 4
HTML ContentParser in vb.net 2
Merging duplicates in a sheet 4

Back
Top