Help me. How to open a new IE window?

Dave Brueck dave at pythonapocrypha.com
Sat May 8 16:04:39 EDT 2004


Vladimir wrote:
> angel wrote:
> > I want python(win32com) to open a new IE window.
> > Source is:
> > /******/
> > import win32com.client
> > msie = win32com.client.Dispatch("InternetExplorer.Application")
> > msie.Visible = 1
> > msie.Naviagte(http://www.python.org)
> > /******/
> > The problem is the program always grabs a existed IExplorer window or
> > Explorer window. It never opens a new window.
>
> import webbrowser
> webbrowser.open_new("www.python.org")
>
> it will work fine with IE (if IE is the default browser)

I guess the OP didn't specify, but the above won't work if you need to control
the browser from then on (which is what I assume he was trying to do by
obtaining an IDispatch pointer to it).

-Dave





More information about the Python-list mailing list