请帮助我使用 Python 2.6 和 win32com。
我是 Python 的新手,在启动下一个程序时出现错误:
import pywintypes
from win32com.client import Dispatch
from time import sleep
ie = Dispatch("InternetExplorer.Application")
ie.visible=1
url='hotfile.com'
ie.navigate(url)
while ie.ReadyState !=4:
sleep(1)
print 'OK'
..........................
Error message:
while ie.ReadyState !=4:
...
pywintypes.com_error:
(-2147023179, 'Unknown interface.', None, None)
..........................
但是,当我将 url 更改为例如“yahoo.com”时 - 没有错误。
检查 ReadyState 的结果如何可能取决于 url?