From d31a21bdc9e895f16c365b9d8bdcd630041032ec Mon Sep 17 00:00:00 2001 From: Philip Norton Date: Sat, 7 Mar 2026 13:50:37 +0000 Subject: [PATCH] 21: Updated the screenshot example as it had a bug in the file_put_contents() function. --- example/chrome_screenshot_example.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/chrome_screenshot_example.php b/example/chrome_screenshot_example.php index cff98ce..ca326f4 100644 --- a/example/chrome_screenshot_example.php +++ b/example/chrome_screenshot_example.php @@ -39,7 +39,7 @@ if ($crawler->getScreenshotType() == ChromeCrawler::SCREENSHOT_TYPE_DATA) { $fileData = $result->getScreenshotFileData(); if (is_string($fileData) && $fileData !== '') { - file_put_contents($fileData, $url->generateHash() . '.png'); + file_put_contents($url->generateHash() . '.png', file_get_contents('data:image/png;base64,' . $fileData)); } }