HTML rendering waits for the page to load

Like URLs, HTML now waits for the load event by default, so its scripts, styles and images are ready before your scripts run and the screenshot is taken.

Changelog1 min read

Written by

Dmytro Krasun

Published on

The wait_until option is documented to default to load, and it did for URLs. For html, though, the API didn’t wait for anything unless you set wait_until.

So HTML that loaded scripts, styles or images from other URLs could be captured before they were ready. A request with scripts that called the page’s own code could also run before that code was loaded and fail: the API then waited for wait_for_selector until it timed out.

Now HTML waits for the load event by default, like a URL. If the page doesn’t finish loading within the navigation timeout, the API renders it as it is instead of failing, as it does for URLs.

HTML that loads slow external resources may now take longer to render. If you don’t need to wait for them, set wait_until=domcontentloaded.

Read more product updates

New features, bug fixes, and optimizations...

View all product updates
ScreenshotOne CLI is available

ScreenshotOne CLI is available

Use command line interface to automate screenshots in your workflows with ScreenshotOne.

Read more

1 min read

Better Markdown output

Better Markdown output

Markdown output is now cleaner by removing non-content HTML blocks during conversion.

Read more

1 min read

ScreenshotOne integration with Dirstarter

ScreenshotOne integration with Dirstarter

Build a directory with Dirstarter and add website screenshots automatically with ScreenshotOne.

Read more

1 min read

Automate website screenshots

Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.