Skip to content

fix: enable wait_for_images on /screenshot endpoint#1792

Open
Br1an67 wants to merge 1 commit intounclecode:mainfrom
Br1an67:fix/issue-1657-screenshot-wait-images
Open

fix: enable wait_for_images on /screenshot endpoint#1792
Br1an67 wants to merge 1 commit intounclecode:mainfrom
Br1an67:fix/issue-1657-screenshot-wait-images

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Summary

Fixes #1657

The /screenshot endpoint created a CrawlerRunConfig without wait_for_images, so images were not loaded before capturing the screenshot. This caused broken/missing images in screenshots.

List of files changed and why

  • deploy/docker/schemas.py — Added wait_for_images field to ScreenshotRequest (defaults to True)
  • deploy/docker/server.py — Pass wait_for_images from request body to CrawlerRunConfig

How Has This Been Tested?

Verified that the CrawlerRunConfig now receives wait_for_images=True by default, which triggers the image-loading wait logic in _crawl_web before screenshot capture.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

The /screenshot endpoint did not set wait_for_images in CrawlerRunConfig,
so images were not waited for before capture. Add wait_for_images param
to ScreenshotRequest (defaults to True) and pass it through to the config.

Closes unclecode#1657
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: screenshot endpoint on self hosted docker instance takes nice screenshot of url, but excluding all images on page

1 participant