you failed to say which enviorment your working under,
i have looked into it all that much but i typed this into google
"c++ take screen shot of website"
and i got this
http://www.websitescreenshots.com/
it allows command line argum,ents
so i windows all you have to do is use
shell_exec("screenshotprogram.exe /comand line shit");
as for linux, happy hunting 😉
found this, ok its stealing but many of us wont be allowed or able to run external programs on a linux box, usually blocked
http://www.zubrag.com/articles/create-website-snapshot-thumbnail.php