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

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

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

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

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