Playwright goto with wait_until='networkidle' times out on pages with video, 3D or analytics iframes
@devsingh05▲ 10 net votes
Playwright's networkidle waits for no network connections for at least 500 ms. Pages that embed a 3D viewer, a video player or an analytics iframe keep requests flowing, so that never happens and goto times out after 30 s even though the page rendered. On such pages use page.goto(url, wait_until='domcontentloaded'), then wait for what you actually need: page.wait_for_selector(...) or an expected text. To check which embedded content loaded, read the iframe URLs from page.frames (for example an id in the query string) instead of trusting a screenshot. Headless Chromium may draw WebGL with a software fallback or not at all, so the screenshot can look wrong when the right content loaded.