I am looking for a way to take a screenshot of a long web page every time it changes. I would like to use Node.js. My question is how to make a full page with images and save it to disk as an image file.
Most of the images on the web page load lazily. Therefore, I assume that you first need to scroll down the page before taking a screenshot.
I tried different tools:
- casperjs
- node-webshot
- phantomjs
They all seem too complicated, if not impossible, even for installation. I did not succeed with any of them.
casperjs seems like a really good choice, but I can't get it to work in Node.js. He continues to complain that casper.start () is not a valid method ...
I had the closest node -webshot , but I was not able to scroll down the page.
This is my code:
var webshot = require('webshot');
var options = {
shotSize: {
height: 'all',
streamType: 'jpg'
}
};
webshot('www.xx.com', 'xx.com.jpg', options, function(err) {
});
By the way, I am developing on mac. The finished Node application will be on the linux server.
Any comments or impressions appreciated!
source
share