Coder Social home page Coder Social logo

Comments (3)

pavelfeldman avatar pavelfeldman commented on May 13, 2024

We strongly discourage the use of networkidle. It is inherently flaky, buy design, so your scripts are guaranteed to flake or break. It might be not obvious, but you can only use networkidle if you control the page and should never use it on a page from the wild. When you control the page you can make assumptions regarding its network organization, while on the real world pages you can't rely on anything. Every other real world page will have a long poll for ads, so networkidle will never occur. Or will have load / web vitals optimizations that would trigger networkidle before the page is loaded, etc etc.

There is no universal way to detect when the page is loaded. Search engines handle it with some success, exploring SEO will give some clue on how. Web vitals will give some interesting signals that can also be used. Virtual clock and other techniques are also worth exploring.

from playwright.

ccll avatar ccll commented on May 13, 2024

@pavelfeldman Thanks very much for your explanation and guidance. I will research the topics you mentioned.

from playwright.

pavelfeldman avatar pavelfeldman commented on May 13, 2024

Closing as per above, please feel free to open a new issue if this does not cover your use case.

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.