uiautomation 库 和 comtpes 库的一个错误
python
运行 uiautomation 库 时
会 comtpes 库 报错
原来是 版本 过高 的.
把 comtpes 库 降到 1.1.7 之后
uiautomation 库 就可运行.
python 3.7 +comtpes 1.1.7 才能够 调试通
以下程序.
若 你的 comtpes 库 是1.3.1 则 会报错
一个 is_porp not attribute erro.
pip install comtypes==1.1.7
=========
import uiautomation as auto
ss='物理数学兴趣爱好进阶'
qq_win = auto.WindowControl(searchDepth=1, ClassName='TXGuiFoundation', Name=ss)
input_edit = qq_win.EditControl()
print("当前输入框:" + input_edit.GetValuePattern().Value)
msg_list = qq_win.ListControl()
items = msg_list.GetChildren()
for one_item in items:
if one_item.Name != "":
print(one_item.Name)