获取IE窗口为IE浏览器开发操作脚本的辅助
from win32com.client import DispatchEx
def GetExamIEWindow():
ShellWindowsCLSID = '{9BA05972-F6A8-11CF-A442-00A0C90A8F39}'
ShellWindows = DispatchEx(ShellWindowsCLSID)
print('%d instances of IE' % len(ShellWindows))
for ie in ShellWindows:
ieTitle = ie.LocationName
if( ieTitle.find('窗口标题') > -1 ):
return ie
return None
IE操作脚本