Skip to content

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

@mrgauthier

Description

@mrgauthier

crawl4ai version

v0.7.7

Expected Behavior

I would expect the screenshot endpoint to include images on the respective url.

Current Behavior

The screenshot is saving beautifully, but with broken images anywhere there is supposed to be an image on the page.

I have tried increasing the screenshot_wait_for param pretty high, and while I can tell the wait is being applied, it's not actually effecting whether or not the images are loaded.

I've also tried passing browserConfig and crawlerConfig params with finer grained control via the POST, however I'm not entirely certain these are being processed (fairly certain they are not) as they are not listed as accepted arguments for the screenshot endpoint.

Is this reproducible?

Yes

Inputs Causing the Bug

POST:  http://localhost:11235/screenshot
w/Body:
{"url":"https://www.price.utah.edu","output_path": "/tmp/screenshot.png", "screenshot_wait_for": 10}

Also tried controlling with extra params, but don't think this will work:
w/Body:
{"url":"https://www.price.utah.edu","output_path": "/tmp/screenshot.png", "screenshot_wait_for": 10,
    "browser_config": {
        "type": "BrowserConfig",
        "params": {
            "headless": true,
            "java_script_enabled": true,
            "user_agent_mode":"random",
            "enable_stealth": true,
            "verbose":true
        }
    },
    "crawler_config": {
        "type": "CrawlerRunConfig",
        "params": {            
            "verbose":true,
            "wait_for_images": true,
            "screenshot_wait_for": 3,
            "scan_full_page": true
        }
    }          
}

Steps to Reproduce

Code snippets

OS

macOSx

Python version

n/a

Browser

No response

Browser version

No response

Error logs & Screenshots (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 BugSomething isn't working🩺 Needs TriageNeeds attention of maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions