[python-win32] Internet Explorer Session independent Creation

Michel Claveau mc at mclaveau.com
Thu Dec 18 00:40:11 CET 2008


Hi!

A way is to launch separate instance, then connect to instances.
Example:


    import os,time,win32com.client

    def finstance(url):
        for instance in 
win32com.client.Dispatch('{9BA05972-F6A8-11CF-A442-00A0C90A8F39}'):
            if instance.LocationURL.find(url)>-1:
                return instance

    os.startfile('http://www.google.fr')
    time.sleep(2)
    os.system('start "" "C:\\Program Files\\Internet Explorer\\iexplore.exe" 
http://www.mclaveau.com/batch')
    time.sleep(3)

    ie1 = finstance('http://www.google.fr')
    ie1.Left=10
    ie1.Top=10
    ie1.Width=600
    ie1.Height=700

    ie2 = finstance('http://www.mclaveau.com/batch')
    ie2.Left=610
    ie2.Top=10
    ie2.Width=600
    ie2.Height=700

    time.sleep(2)




@-salutations
-- 
Michel Claveau 



More information about the python-win32 mailing list