Help me. How to open a new IE window?

Sean Ross sross at connectmail.carleton.ca
Sat May 8 09:56:26 EDT 2004


"angel" <dai4happy at yahoo.com> wrote in message
news:c7iaqu$2400$1 at news.f.de.plusline.net...
> Hi
>
> 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.
>
> Please help me. Thanx
> Victor
>


Hi. Perhaps you may want to check out the webbrowser module:

>>> import webbrowser as browser
>>> browser.open("www.python.org", new=True)

OR

>>> browser.open_new(url)


OR

>>> IE = browser.WindowsDefault()
>>> IE.open_new(url)


HTH,
Sean





More information about the Python-list mailing list