|
-
Apr 7th, 2006, 11:03 AM
#1
Thread Starter
Hyperactive Member
wait for website to finished loading webbrowser control
Hey,well im using webbrowser control and when it submits the submit button it takes while to load then will say "loaded" on this site,the problem is it has code after and it loads b4 the site is loaded i tried using sleep but still buggy
WebBrowser1.Document.All.submit.Click
Sleep 9000
WebBrowser1.GoBack
thats what im using but it "freezes" well sleeps so it cant finish loading the site then goes bak,so basicaly i want the site to finish loading after clicking submit then go bak to the page thanks
Last edited by Mr_Zer0; Apr 7th, 2006 at 11:48 AM.
-
Apr 7th, 2006, 11:05 AM
#2
Member
Re: how wait for site to load
try the WebBrowser_DocumentComplete event also check if the document object is nothing if so then exit the event
-
Apr 7th, 2006, 11:12 AM
#3
Thread Starter
Hyperactive Member
Re: how wait for site to load
-
Apr 7th, 2006, 11:25 AM
#4
Thread Starter
Hyperactive Member
Re: how wait for site to load
-
Apr 7th, 2006, 12:22 PM
#5
Thread Starter
Hyperactive Member
Re: wait for website to finished loading webbrowser control
-
Apr 7th, 2006, 12:31 PM
#6
Re: wait for website to finished loading webbrowser control
VB Code:
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB1.Application) Then
'code here
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 7th, 2006, 12:43 PM
#7
Thread Starter
Hyperactive Member
Re: wait for website to finished loading webbrowser control
hmm i dont understand how to use this ?
-
Apr 7th, 2006, 12:48 PM
#8
Re: wait for website to finished loading webbrowser control
thats the webborwser_documentcomplete event...
the pdisp is webbrowser... is to check to make sure the ENTIRE page is loaded...
so you code goes inside the IF statement..
chec the URL to see where u are
IF URL = "whatever.." then
Click submit...
Else
Go back
end if
kinda like that
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 7th, 2006, 01:02 PM
#9
Thread Starter
Hyperactive Member
Re: wait for website to finished loading webbrowser control
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB1.Application) Then
WebBrowser1.Navigate "www.google.com"
End If
End Sub
Private Sub Form_Load()
If URL = "www.google.com" Then
MsgBox "hi"
Else
End If
End Sub
maybe somthing like this?but doesnt load i respect you for tryin to help
-
Apr 7th, 2006, 01:17 PM
#10
Thread Starter
Hyperactive Member
Re: wait for website to finished loading webbrowser control
hey i got it to work but this way is buggy for me any over ways?thanks
-
Apr 7th, 2006, 02:29 PM
#11
Re: wait for website to finished loading webbrowser control
like this
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.google.com"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print URL
If (pDisp Is WebBrowser1.Application) Then
If URL = "http://www.google.com/" Then
WebBrowser1.Document.All.q.Value = "TEST SEARCH"
WebBrowser1.Document.All.btnG.Click
Else
MsgBox "Search Results"
End If
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|