• 请不要在回答技术问题时复制粘贴 AI 生成的内容
nextone
V2EX  ›  程序员

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

  •  
  •   nextone · May 2, 2023 · 2257 views
    This topic created in 1133 days ago, the information mentioned may be changed or developed.

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

    rimworld
        1
    rimworld  
       May 2, 2023
    nextone
        2
    nextone  
    OP
       May 2, 2023
    文档里 locator.is_visible()也弃用了
    ymcyyf
        3
    ymcyyf  
       May 2, 2023
    https://playwright.dev/python/docs/api/class-locator#locator-wait-for
    可以用 locator.wait_for() ?返回值自己处理下就好
    S9Yh4wIFsBG7jnE4
        4
    S9Yh4wIFsBG7jnE4  
       May 3, 2023
    元素方法里有 wait_XXX 方法用这个 如果不行 就用等待时间
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5517 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 08:33 · PVG 16:33 · LAX 01:33 · JFK 04:33
    ♥ Do have faith in what you're doing.