首页 > 代码库 > Python 找到已经存在IE实例

Python 找到已经存在IE实例

#coding=utf-8

import win32com.client

clsid=‘{9BA05972-F6A8-11CF-A442-00A0C90A8F39}‘
ShellWindows=win32com.client.Dispatch(clsid)
for i in range(ShellWindows.Count):
print i
# this is the titlebar value
print ShellWindows[i].LocationName
# this is the current URL
print ShellWindows[i].LocationURL