Skip to main content

capture_screenshot

Function capture_screenshot 

Source
pub async fn capture_screenshot(url: &str) -> Result<Vec<u8>>
Expand description

Capture a PNG screenshot of a URL

This function uses browser-commander to launch a headless browser, navigate to the URL, and capture a screenshot.

§Arguments

  • url - The URL to capture

§Returns

The PNG image data as bytes

§Errors

Returns an error if browser operations fail