[python-win32] Referencing IE's DOM when using free threadwin32com.client.DispatchWithEvents

Rex Corrovan rex555 at hotmail.com
Mon May 14 21:26:20 CEST 2007


So I am not sure what research you have done, or if this is inherited, or 
how much refactoring you would need to do, but out of curiousity, have you 
thought about using PAMIE? I have used it with quite a lot of success. It 
may not be the answer you are looking for, but you might want to have a look 
at it.

http://pamie.sourceforge.net/

-Rex


From: "Richard Bell" <rbell01824 at earthlink.net>
To: <python-win32 at python.org>
Subject: [python-win32] Referencing IE's DOM when using free 
threadwin32com.client.DispatchWithEvents
Date: Fri, 11 May 2007 19:40:15 -0400

My adventures in IE automation continue.  I'm now able to start IE, navigate
to a page, and process events as they occur. Unfortunately, when I try to
reference the document after it is loaded and displayed I encounter a number
of problems.

The relevant code is as follows:

     self.ie = win32com.client.DispatchWithEvents(
                 "InternetExplorer.Application",
                 ieEvents)

     (snip)

     ie.Navigate(url)	# navigate to page

     (snip)

     try:
         frames = yie.ie.Document.frames
         print "Frames length", frames.length
     except:
         print "No frames error"
         print sys.exc_info()

This last bit of code prints

     No frames error
     (<class 'pywintypes.com_error'>, com_error(-2147467262, 'No such
interface supported', None, None), <traceback object at 0x00CC1418>)

In an effort to correct the problem, I ran MakePY against several interfaces
that looked like they might be appropriate.  Subsequently, the code

     print "Ready State", ie.Document.ReadyState

which had been working also started to generate a 'No such interface
supported' error.

I've modeled my access to the DOM after cPamie and run it's certification
routines to verify that Python is generally sound.

Does anyone know how to address this issue?

Thanks,
Richard




_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32

_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows 
Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507



More information about the Python-win32 mailing list