不是什么正经教程,就是一些坑,pywinauto真的好坑啊!
是win32还是uia,不用管,随便写一个,启动程序后看报错,如果报错如下,就换另外一个
pywinauto.findbestmatch.MatchError: Could not find '程序名0 in 'dict_keys([‘程序名1’, ‘程序名’2, ‘程序名3’])’
如果层级没错,比如
app['a1']['a2']
但是报错如下
AttributeError: The control does not have a getitem method for item access (i.e. ctrl[key]) so maybe you have requested this in error?
不要用简写,拆开用child_window写
a=app['a1']
a.child_window(title="a2")