I am trying to take a look at the IE DOM from a separate thread that IE sent, and for some properties I get a "no such interface" error. I managed to reduce the problem to this script:
import threading, time import pythoncom from win32com.client import Dispatch, gencache gencache.EnsureModule('{3050F1C5-98B5-11CF-BB82-00AA00BDCE0B}', 0, 4, 0)
Everything is fine until frame.contentWindow . Then bam:
Exception in thread Thread-2: Traceback (most recent call last): File "C:\python22\lib\threading.py", line 414, in __bootstrap self.run() File "C:\python22\lib\threading.py", line 402, in run apply(self.__target, self.__args, self.__kwargs) File "testie.py", line 42, in printframes obj = frame.contentWindow File "C:\python22\lib\site-packages\win32com\client\__init__.py", line 455, in __getattr__ return self._ApplyTypes_(*args) File "C:\python22\lib\site-packages\win32com\client\__init__.py", line 446, in _ApplyTypes_ return self._get_good_object_( com_error: (-2147467262, 'No such interface supported', None, None)
Any clues?
source share