gpt4 book ai didi

pywinauto - 按类型查找子元素过滤器

转载 作者:行者123 更新时间:2023-12-03 07:57:06 24 4
gpt4 key购买 nike

我想在窗口中找到子元素,但只能是某种类型/
类(class)。

我使用该代码:

def get_visible_buttons(window):
children = window.Children()
return [
child for child in children
if child.FriendlyClassName() == 'Button'
and child.is_visible()
]

有没有过滤子列表的最佳方法?
谢谢

最佳答案

它来自 pywinauto 0.6.0(目前在 master 分支)。

buttons_only = window.children(control_type='Button')

可能的控制类型列表将被完成。 children() 的关键字参数列表还没有完成。见 the code .

关于pywinauto - 按类型查找子元素过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40111006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com