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

Wade Leftwich wade at leftwich.us
Sat Jan 22 21:39:55 CET 2005


On Dec 7, Steve McDonald wrote:

> 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
> 
> 

I just ran into the exact same roadblock. I don't have a solution, but I 
did get to test the same program on XP and 2000, and it produced the 
same error with both OS's. Both boxes are running the latest update of 
IE6, so maybe it's an IE security thing we're getting snagged on.

I too would *really* appreciate a solution or even a hint.

-- Wade Leftwich
Ithaca, NY





More information about the Python-win32 mailing list