Downloading pages from a Windows Intranet

R.Marquez ny_r_marquez at yahoo.com
Mon Apr 29 11:08:04 EDT 2002


After taking a look at my options (and considering my humble state of
expertise)
I decided that the easiest route for me to work around the
authentication issue was to use COM to control IE.  It worked.
Using win32com.Distpatch to navigate to the pages works well for my
needs inside our intranet.

However, trying to use DispatchWithEvents (to make a more generic way
of waiting for a page to load for use outside our intranet) has given
me problems.

As suggested, I created a simple class to recieve the events. 
Something like:

class IEEvents:
    def OnBeginDownload(self):
        print "Download began"
    def OnDownloadComplete(self):
        print "Download completed"
    def ...

Then, when I try this: 

import win32com.client
ie = win32com.client.DistpatchWithEvents('InternetExplorer.Application',
IEEvents)
ie.Navigate(someurl)

I see that the OnBeginDownload event gets fired, but that is it.  IE
seems to be help up by something so that it can not complete the
Navigation.  If I kill Python at that point, IE proceeds to finish the
download of the page and displays it.  Any suggestions?

(PS: I stil hope that one day someone savy enough with the use of
calldll will be able to make a module to control the WININET.DLL and
share it with the rest of us. :-)



More information about the Python-list mailing list