browser_wait_for_network_idle

Summary: Browser Wait For Network IdlePOST /api/execute/browser_wait_for_network_idle

Blocks automation progress until inflight HTTP, Fetch, and XMLHttpRequest connections remain at zero for a quiet window. The Chromium resource dispatcher tracks active socket requests, stylesheet downloads, script fetches, and asynchronous API calls initiated by the document. Every time the pending connection counter drops to zero, an internal countdown starts for the specified silence threshold. If a lazy-loaded image or script initiates another transfer before that countdown finishes, the timer resets and continues monitoring. When silence persists across the entire threshold, the command resolves with elapsed duration metadata. Should background polling, Server-Sent Events, or WebSocket heartbeats prevent quietness before the deadline expires, a timeout error is returned. This synchronization mechanism guarantees that dynamic single-page views finish hydrating data before extraction begins.

Parameters

NameTypeRequiredDescription
context_idstringyesTarget session identifier monitored for pending HTTP and asynchronous fetch activity.
idle_timestringnoContinuous quiet period in milliseconds with zero active transfers required to declare readiness.
timeoutstringnoMaximum millisecond deadline to await connection quiescence before aborting with an error.

Usage

result = await browser.wait_for_network_idle(context_id=context_id)

See Also