Screen Capture multiple websites using phantomjs

594 views Asked by At

Hi I need to download or (if not possible) take screen shots of multiple webpages which has images rendered using javascript(slick slides). using the phantomjs code for screen capture given in the website im able to take screen shot of a single web site. but im not able to manipulate the code to capture screenshots from multiple websites at once.

Any help would be greatly appreciated. eg site: http://www.flipkart.com/womens-clothing?otracker=nmenu_sub_women_0_All%20Clothing need to capture banners from the site

2

There are 2 answers

1
Kishore On

var page = require('webpage').create();
page.viewportSize = { width: 1024, height: 768 };
page.clipRect = { top: 0, left: 0, width: 1024, height: 768 };
page.open('http://example1.com/', function() {
  page.render('exampl1.png');
var page = require('webpage').create();
page.viewportSize = { width: 1024, height: 768 };
page.clipRect = { top: 0, left: 0, width: 1024, height: 768 };
page.open('http://example2.com/', function() {
  page.render('exampl2.png');
phantom.exit();
});``

0
seagulf On

You can use IRobotSoft web scraper to do it. Just let it go to different websites and call function CapturePage(filename) to capture the page into an image file.