Sizin için biraz karmaşık bir olay. Yanlış anlaşılmasın, bu soruyu sormanıza ve kaynak yok demenize göre değerlendirdim. O yüzden ekran görüntüsü almanızı sağlayan bir site ile API kullanalım.
<?php
$token = 'TOKEN_ANAHTARI';
$url = urlencode('https://github.com');
$width = 1920;
$height = 1080;
$output = 'image';
$query = "https://screenshotapi.net/api/v1/screenshot";
$query .= "?token=$token&url=$url&width=$width&height=$height&output=$output";
$image = file_get_contents($query);
file_put_contents('./screenshot.png', $image);Ve sonuç:
Tıkla