There is the URL of page on the Internet. I need to get a screenshot of this page (no matter in which browser).
I need a script (PHP, Python (even Django framework)) that receives the URL (string) and output screenshot-file at the exit (file gif, png, jpg).
UPD:
I need dynamically create a page where opposite to URL will be placed screenshot of the page with the same URL.
Why do you need a script when you can use a service from another site?
Check for example what I am using: WebSnapr http://www.websnapr.com/
Or check http://www.google.ro/search?ie=UTF-8&q=website+thumbnail if something else fits your request.
PhantomJS is a better option for generating screenshot from URL. The following script demonstrates the simplest use of page capture. It loads the Github homepage and then saves it as an image, github.png. Code
To run this example create a new file called github.js. Copy and paste the above code into the github.js file. In the commandline, run this newly created script with PhantomJS:
There a lot of projects for generating screenshots using PhantomJS. Pageres generates reliable screenshots and its based on NodeJS and PhantomJS.
If you are family with Python, you can use PyQt4. This library supports to get screenshot from a url.
You can use, as I do, the shotbox API
It's in french, but still, quickly:
To get your API key : http://translate.google.fr/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fwww.shotbot.net%2Fcreer-un-compte-webmaster.php
Pass the url as argument and you'll get the image for more details check this link http://zenithwebtechnologies.com.au/auto-thumbnail-generation-from-url.html
Solution using Google Page Speed - tested & working.