def TestAll():
try:
try:
iexplore = win32com.client.dynamic.Dispatch("InternetExplorer.Application")
TestExplorer(iexplore)
win32api.Sleep(1000)
iexplore = None
# Test IE events.
TestExplorerEvents()
# Give IE a chance to shutdown, else it can get upset on fast machines.
time.sleep(2)
# Note that the TextExplorerEvents will force makepy - hence
# this gencache is really no longer needed.
from win32com.client import gencache
gencache.EnsureModule("{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}", 0, 1, 1)
iexplore = win32com.client.Dispatch("InternetExplorer.Application")
TestExplorer(iexplore)
except pythoncom.com_error, exc:
if exc.hresult!=winerror.RPC_E_DISCONNECTED: # user closed the app!
raise
finally:
iexplore = None
评论列表
文章目录