Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?

Question posted by: gcmartijn@gmail.com (Guest) on July 5th, 2008 08:15 AM
H!

I using a script that opens a internet page in a small window (what I
can control)
In XP everything was working fine, but now I'm using Vista with IE7
and this is what happends now:

First a small window opens at the postion x0 y0 (like I want) but then
IE thinks "Hey lets open a other main window too".
And that window opens the url 'http://www.google.nl'

It seems that I can't control/use my first window anymore, and that
IE7/vista is forcing to open it in a big new window.

The code below is what I'm using.

def webbrowser(url=None):
import pythoncom
from win32com.client import Dispatch

ie = pythoncom.CoCreateInstance("InternetExplorer.Application",
None,pythoncom.CLSCTX_SERVER,pythoncom.IID_IDispat ch)
ie = Dispatch(ie)
ie.Top = 0.0
ie.Left = 0.0
ie.Height = 400
ie.Width = 400
ie.AddressBar = False
ie.MenuBar = False
ie.Resizable = False
ie.StatusBar = False
ie.ToolBar = False
ie.Visible = 1
return ie

w = webbrowser()
w.Navigate('http://www.google.nl')

--
ow and why can't I find a pythoncom.CoCreateInstance.FireFox example ?

Thanks for helping.
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Méta-MCI \(MVP\)'s Avatar
Méta-MCI \(MVP\)
Guest
n/a Posts
July 5th, 2008
09:25 PM
#2

Re: pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?
Hi!

Your code run OK for me (Vista Ultimate).
This other version run also OK :

def webbrowser(url=None):
import win32com.client, time

ie=win32com.client.Dispatch('InternetExplorer.Appl ication')
while ie.Busy==True:
time.sleep(0.125)
ie.Top = 0
ie.Left = 0
ie.Height = 400
ie.Width = 400
ie.AddressBar = False
ie.MenuBar = False
ie.Resizable = False
ie.StatusBar = False
ie.ToolBar = False
ie.Visible = 1
return ie

w = webbrowser()
w.Navigate('http://www.google.nl')





@-salutations
--
Michel Claveau



Terry Reedy's Avatar
Terry Reedy
Guest
n/a Posts
July 5th, 2008
10:35 PM
#3

Re: pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?


Join Bytes! wrote:
Quote:
Originally Posted by
H!
>
I using a script that opens a internet page in a small window (what I
can control)
In XP everything was working fine, but now I'm using Vista with IE7
and this is what happends now:
>
First a small window opens at the postion x0 y0 (like I want) but then
IE thinks "Hey lets open a other main window too".
And that window opens the url 'http://www.google.nl'


Perhaps on XP you changed the IE homepage to about:blank. On your Vista
machine, it is set to Google, perhaps by the manufacturer (for a fee).
Try changing it.


gcmartijn@gmail.com's Avatar
gcmartijn@gmail.com
Guest
n/a Posts
July 6th, 2008
10:15 AM
#4

Re: pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?
On 5 jul, 15:27, Terry Reedy <tjre...@udel.eduwrote:
Quote:
Originally Posted by
gcmart...@gmail.com wrote:
Quote:
Originally Posted by
H!

>
Quote:
Originally Posted by
I using a script that opens a internet page in a small window (what I
can control)
In XP everything was working fine, but now I'm using Vista with IE7
and this is what happends now:

>
Quote:
Originally Posted by
First a small window opens at the postion x0 y0 (like I want) but then
IE thinks "Hey lets open a other main window too".
And that window opens the url 'http://www.google.nl'

>
Perhaps on XP you changed the IE homepage to about:blank. *On your Vista
machine, it is set to Google, perhaps by the manufacturer (for a fee).
Try changing it.


Nope when its about:blank I get that google page (because I say that
in the script)

gcmartijn@gmail.com's Avatar
gcmartijn@gmail.com
Guest
n/a Posts
July 6th, 2008
10:15 AM
#5

Re: pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?
On 5 jul, 14:14, "Méta-MCI \(MVP\)" <enleverlesX.X...@XmclaveauX.com>
wrote:
Quote:
Originally Posted by
Hi!
>
Your code run OK for me (Vista Ultimate).
This other version run also OK :
>
def webbrowser(url=None):
* * import win32com.client, time
>
* * ie=win32com.client.Dispatch('InternetExplorer.Appl ication') **
* * while ie.Busy==True:
* * * * time.sleep(0.125)
* * ie.Top = 0
* * ie.Left = 0
* * ie.Height = 400
* * ie.Width = 400
* * ie.AddressBar = False
* * ie.MenuBar *= False
* * ie.Resizable = False
* * ie.StatusBar = False
* * ie.ToolBar = False
* * ie.Visible = 1
* * return ie
>
w = webbrowser()
w.Navigate('http://www.google.nl')
>
@-salutations
--
Michel Claveau


I use your script now but I'm still getting 2 windows I uploaded a
screenshot how it looks.
1 at the background my window (but that is loading nothing)
1 at on top with the site http://www.google.nl (because that is in the
script)

http://img376.imageshack.us/img376/5506/capturess8.jpg

Méta-MCI \(MVP\)'s Avatar
Méta-MCI \(MVP\)
Guest
n/a Posts
July 6th, 2008
11:05 PM
#6

Re: pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?
Hmmmm... I have a similary problem, in another circumstances.
It's often a problem of configuration of IE (for news customers). But,
it is not easy, because IE has many parameters.

Good luck!

Michel Claveau


gcmartijn@gmail.com's Avatar
gcmartijn@gmail.com
Guest
n/a Posts
July 7th, 2008
05:35 PM
#7

Re: pythoncom InternetExplorer.Application don't work in vista || firefoxpythoncom ?
On 6 jul, 16:00, "Méta-MCI \(MVP\)" <enleverlesX.X...@XmclaveauX.com>
wrote:
Quote:
Originally Posted by
Hmmmm... *I have a similary problem, in another circumstances.
It's often a problem of configuration of IE (for news customers). *But,
it is not easy, because IE has many parameters.
>
Good luck!
>
Michel Claveau


IE have many options, you say that the code is working so I was hoping
that you could answer these questions:
- Is your tabbed browsing on ?
- Do you use the default 'securiy' settings ?
- Do you use by privacy option: Medium ?
- The advanced options are to much to ask here :(

Greetings,
GCMartijn

 
Not the answer you were looking for? Post your question . . .
182,371 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors