|
-
Aug 6th, 2001, 01:36 PM
#1
Thread Starter
Hyperactive Member
Webbrowser - Detect Page Downloaded
I need to be able to call a function when a document is completed downloading.
I have tried this:
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Call MyFunction
End Sub
But, MyFunction calls performs and operation and then calls another webpage. But, the Private Sub Document Complete seems to be getting ahead of itself and not waiting for the page to completely load.
Is there any way I can truly wait to call that function after the page has fully loaded?
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 6th, 2001, 01:44 PM
#2
Frenzied Member
Try something like this:
VB Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp is WebBrowser1.Object) Then
If URL = "http://www.the-url-where-you-want-to-call-your-function.com"
Call MyFunction
End If
End If
End Sub
-
Aug 6th, 2001, 01:44 PM
#3
Thread Starter
Hyperactive Member
This sorta works:
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Object) Then
Call MyFunction
End If
End Sub
But, it doesn't appear to work with detecting a page with frames.
Can anyone assist?
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 6th, 2001, 01:45 PM
#4
Thread Starter
Hyperactive Member
Thanks Bloodeye, but the URL is constantly changing? Is there another way?
And, the URL is hidden the frame of the page loading.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 6th, 2001, 01:54 PM
#5
Frenzied Member
If you just go with:
VB Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Object) Then
Call MyFunction
End If
End Sub
This is all you need. When the condition (pDisp Is WebBrowser1.Object) is met then the web-page including all the frames within have completely loaded.
-
Aug 6th, 2001, 01:54 PM
#6
Frenzied Member
can't you just use the document_complete function... why do you need the other code??
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 6th, 2001, 01:55 PM
#7
Frenzied Member
found it
Private Sub WebBrowser1_DownloadComplete()
End Sub
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 6th, 2001, 02:04 PM
#8
Thread Starter
Hyperactive Member
No, that's not it.
That will crash the program. That Sub isn't intended to detect when a page in the frame is finished loading.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 6th, 2001, 02:05 PM
#9
Frenzied Member
ok... sry haven't used the browser control in awhile, im working on making my own
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 6th, 2001, 02:15 PM
#10
Frenzied Member
bedowin -
What is it your trying to do with your function?
-
Aug 6th, 2001, 02:54 PM
#11
Thread Starter
Hyperactive Member
The Function takes the HTML source of the page loaded and parses out necessary information.
My problem is that sometimes the server doesn't return the page in a timely manner, so that even putting in a wait event for 10 seconds might not be sufficient to make sure the framed page is loaded completely.
I just want some assurance that it is loaded, and am wondering if there is a way to accomplish this.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 6th, 2001, 03:03 PM
#12
Fanatic Member
my prog had to do the same thing...Bloodeyes method works..
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Aug 6th, 2001, 03:39 PM
#13
Thread Starter
Hyperactive Member
yes.. his method would work, if I knew the ever-changing URL.
In this case I do not.
However, I have just solved this problem I believe.
What I did was do a search for footer text that appears on each loaded page. If it appears, then my parsing code runs, if not then it attempts to reload the page complete and will not run the parsing code until it finds the footer text.
woohoo!
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
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
|