V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nextone
V2EX  ›  程序员

playwright 问题, page.is_visible()废弃了

  •  
  •   nextone · 331 天前 · 1165 次点击
    这是一个创建于 331 天前的主题,其中的信息可能已经有所发展或是发生改变。

    page.is_visible()废弃了,现在如果我想要判断一个元素出现时返回 True ,超时未出现返回 False ,该怎么做呢?不想要自定义函数。

    rimworld
        1
    rimworld  
       331 天前
    nextone
        2
    nextone  
    OP
       331 天前
    文档里 locator.is_visible()也弃用了
    ymcyyf
        3
    ymcyyf  
       331 天前
    https://playwright.dev/python/docs/api/class-locator#locator-wait-for
    可以用 locator.wait_for() ?返回值自己处理下就好
    shayang888
        4
    shayang888  
       330 天前
    元素方法里有 wait_XXX 方法用这个 如果不行 就用等待时间
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5881 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:27 · PVG 10:27 · LAX 19:27 · JFK 22:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.