Convert URL to screenshot (script)

There is a page URL on the Internet. I need to get a screenshot of this page (no matter which browser).

I need a script (PHP, Python (even the Django framework)) that receives a URL (string) and displays a screenshot of the output file (gif, png, jpg file).

UPD:

I need to dynamically create a page where a screenshot of the page with the same URL will be placed opposite the URL.

+6
python url php django screenshot
source share
6 answers

Why do you need a script when you can use the service from another site?
Check for example what I'm using: WebSnapr http://www.websnapr.com/
Or check http://www.google.ro/search?ie=UTF-8&q=website+thumbnail if something else matches your request.

+7
source share

You can use, like me, the shotbox API

This is in French, but still, quickly:

  • Use http://add.shotbot.net/k= key / url , where the key is your API key and URL ... the page you want as a screenshot.
  • Use http://static.shotbot.net/ md5url / format .jpg or http://cache.shotbot.net/s= format / url where the format can be 80 (80x60), 92 (92x69), 120 (ascreen 120x90), 160 (160x120), 240 (240x180), 320 (320x240), 1024 (1024x768)

To get the 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

0
source share
<img src='http://zenithwebtechnologies.com.au/thumbnail.php?url=www.subway.com.au'> 

Pass url as an argument and you will get an image for more details. Check out this link http://zenithwebtechnologies.com.au/auto-thumbnail-generation-from-url.html

0
source share

If you work with Python, you can use PyQt4. This library supports taking screenshots from a URL.

0
source share

PhantomJS is the best option for creating screenshots from URLs. The following script demonstrates the simplest use of page capture. It loads the Github homepage and then saves it as an image, github.png. The code

 var page = require('webpage').create(); page.open('http://github.com/', function() { page.render('github.png'); phantom.exit(); }); 

To run this example, create a new file called github.js. Copy and paste the above code into the github.js file. At a command prompt, run this newly created script using PhantomJS:

 phantomjs github.js 

Here are a lot of projects for taking screenshots using PhantomJS. Pageres creates reliable screenshots and is based on NodeJS and PhantomJS.

0
source share

There is also http://webshot.mine.sk/ for free without restrictions, several APIs (js, jquery, php)

-one
source share

All Articles