separate IE instances?

J Correia correiajREMOVECAPS at hotmail.com
Tue Jun 7 16:39:55 EDT 2005


> "Chris Curvey" <ccurvey at gmail.com> wrote in message
> news:1118165668.863841.291290 at z14g2000cwz.googlegroups.com...
> > I would have given up on this a long time ago, but I can create two
> > IEXPLORE processes simultaneously (and get the behavior I want) by just
> > manually launching them from the Start menu.   (Of course, that doesn't
> > mean that I can launch them programmatically, but I'm hoping that
> > someone can give me a definitive answer.)
> >

"J Correia" <correiajREMOVECAPS at hotmail.com> wrote in message
news:LYlpe.38956$HI.25521 at edtnps84...
> Right, I hadn't quite understood your problem when I posted my reply.  The
code
> posted does work and allow navigation, etc. but you do have the problem with
it
> sharing the same session cookies (I'm also on Win2k).  And to answer Martin,
you
> can definitely create as many iexplore.exe instances as you like in Windows.
>
> How to get Python to launch several instances with COM... not sure, although
I'm
> 99% certain it is doable.  I'll hunt around and see if I can find a solution
> which I'll post back.

A very quick and very, very dirty method which might work is to start up
the instances as follows:
import win32api
a = win32api.ShellExecute(0,None,"iexplore.exe",None,None,1)
b = win32api.ShellExecute(0,None,"iexplore.exe",None,None,1)
 This creates the 2 instances of iexplore.exe in Windows you're looking for.

Then use code like this to attach to the already running instances:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/269345

Haven't tried it because I'm certain there's a much more elegant solution, but
depending on how quickly you need to get going it might be a possible short term
work around until someone posts the better way.  Perhaps you can also post some
more info on what you're actually trying to achieve... make it easier for
someone to
help or even suggest alternatives.

JC








More information about the Python-list mailing list