zshot/cliDownload

--wait-for

CLI
--wait-for
Defaultload

Sets when the page is captured.

ValueWhen
loadThe window.load event
readyThe DOMContentLoaded event
networkidle0After the load event, once no request has started or finished for 500ms
networkidle2After the load event, once no request has started or finished for 1 second, with up to two still open
js:NAME_OF_EVENTWhen a CustomEvent of that name fires on window: js:my_event captures once the page runs window.dispatchEvent(new CustomEvent("my_event"))
css:SELECTORWhen a DOM element matching this selector exists on the page
text:TEXTWhen the page’s visible text contains TEXT
notext:TEXTWhen the page’s visible text does not contain TEXT
Any numberThat many seconds after DOMContentLoaded: 5, 2.5, or 0 for no delay

Text

text: and notext: match the page’s visible text exactly, case-sensitive. notext:Please wait holds the capture while a placeholder is showing. A page that never changes ends at --timeout.

To wait for an element to disappear, negate a selector: css:html:not(:has(.spinner)).

Delays

Append seconds to networkidle0 or networkidle2 to wait that much longer once the network is idle: networkidle0:2.5.

Redirects

To capture the destination of a redirect that fires after the page loads, such as a delayed meta-refresh or a timed script redirect, set a number of seconds larger than the redirect delay.

Example

Run locally
zshot --wait-for 5 https://zshot-cli.com/