from pywinauto import application
app = application.Application().connect(process=7996)
app.print_control_identifiers()为什么这段代码不能工作?它会产生错误。
AttributeError: Neither GUI element (wrapper) nor wrapper method 'print_control_identifiers' were found (typo?)我能想到的唯一原因是因为它是一个64位的应用程序,而我有32位的Python。
发布于 2018-09-21 18:34:24
connect()在您的代码中工作得很好。下一行:print_control_identifiers()不是app对象的方法。您需要为此创建顶级窗口规范:
app.TopWindowTitle.print_control_identifiers()要列出顶级窗口标题,请执行以下操作:
print([w.window_text() for w in app.windows()])https://stackoverflow.com/questions/52433492
复制相似问题