Rex,

I have looked at PAMIE rather carefully.  Indeed, about a year ago I
exchanged a number of emails with one of the authors.  There are a couple of
underlying problems with PAMIE's approach to IE automation.  The most
serious is that it doesn't do a very good job of detecting page completion.
Indeed, the source notes the problem.  There is also a hack to get around
what is essentially a bug when referencing the DOM before it is ready.
Beyond that, it doesn't effectively handle popups, something that some web
applications use heavily.  Additionally, although less seriously, there is
no support for tabs.  Last, but certainly not least, I'm a hacker at heart
and it's an interesting problem.

I've learned a bit more about the problem since the previous post.  It
appears that if calls are made to pump messages, never mind that it is a
free thread model, the DOM can be referenced.  I'm not sure what the issue
is and will let Mark Hammond know what I've found.

If anyone knows a work around, I'd appreciate some guidance.

Regards,
Richard



Rex Wrote
|
|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" <[EMAIL PROTECTED]>
|To: <python-win32@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@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to