page.is_visible()废弃了,现在如果我想要判断一个元素出现时返回 True ,超时未出现返回 False ,该怎么做呢?不想要自定义函数。
1
rimworld 142 天前
没用过 playwright ,看了下文档,推荐用 locator.is_visible()的方式了。
https://playwright.dev/python/docs/api/class-page#page-is-visible https://playwright.dev/python/docs/api/class-locator#locator-is-visible |
![]() |
2
nextone OP 文档里 locator.is_visible()也弃用了
|
3
ymcyyf 142 天前
https://playwright.dev/python/docs/api/class-locator#locator-wait-for
可以用 locator.wait_for() ?返回值自己处理下就好 |
![]() |
4
shayang888 141 天前
元素方法里有 wait_XXX 方法用这个 如果不行 就用等待时间
|