[python-win32] Internet Explorer COM issues with XP SP2?

Steve Mcdonald steve.mcdonald at ninaza.com
Tue Dec 7 23:12:26 CET 2004


Replying to message from Bryan Kamrath from back in October:

> I am using the PAMIE
> (http://pamie.sourceforge.net) module for doing some
> automated web testing.  This module works with the
> Internet Explorer COM object to drive Internet
> Explorer by automating navigates, button clicks, the
> filling out of forms, etc.  However, since I upgraded
> to XP SP2 I have not gotten this module to work very
> well.  It seems that every time I try and fire an
> event fown to the COM object (like an "onchange")
> event I get the 'Access Denied' COM error.

I'm having the same problem, and I haven't been able to find an answer
either. The following code demonstrates the problem without using PAMIE:

from win32com.client import DispatchEx
import time

ie = DispatchEx("InternetExplorer.Application")
ie.Visible = 1
ie.Navigate("http://google.com")
# wait for page to finish loading
while ie.Busy:
    time.sleep(0.1)
while ie.Document.ReadyState != 'complete':
    time.sleep(0.1)
ie.Document.forms['f'].elements.all['q'].value = "win32all"
# the following line throws an exception on XP SP2:
ie.Document.forms['f'].elements.all['q'].fireEvent('onchange')
ie.Quit()

The full error produced is:

Traceback (most recent call last):
  File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py"
, line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\smcdonald\Desktop\xpsp2test.py", line
14, in ?
    ie.Document.forms['f'].elements.all['q'].fireEvent('onchange')
  File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line
165, in __call__
    return
self._get_good_object_(self._oleobj_.Invoke(*allArgs),self._olerepr_.def
aultDispatchName,None)
com_error: (-2147024891, 'Access is denied.', None, None)

If anyone has any solutions or suggestions, I'd love to hear them.

-Steve



More information about the Python-win32 mailing list