COM automation, Internet Explorer, DocumentComplete event

puff rbell01824 at earthlink.net
Tue Jan 10 15:09:43 EST 2006


I'm very new to Python and have a question concerning IE automation and
detection of page completion.

The MSDN article 180366 states in part:

----
The top-level frame fires the DocumentComplete in the end. So, to check
if a page is done downloading, you need to check if the IDispatch*
parameter is same as the IDispatch of the WebBrowser control.

For Visual Basic, here is code that performs this check:

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object,
                                         URL As Variant)
   If (pDisp Is WebBrowser1.Object) Then
      Debug.Print "Web document is finished downloading"
   End If
End Sub
----

I'm able to catch IE's events including DocumentComplete with:

    def OnDocumentComplete(self, pDisp, URL):

so i have pDisp.  Self is the object returned by:

        self.ie = DispatchWithEvents("InternetExplorer.Application",
InternetExplorerEvents)

that created the automation object.  How do I perform the test in
Python?

Thanks for any help.




More information about the Python-list mailing list