I am trying to use phantomjs-node to capture screen. In my component i import const phantom = require('phantom');
. Then after click i want to run method -
printOnePage(){
phantom.create().then(function(ph) {
ph.createPage().then(function(page) {
page.open('https://stackoverflow.com/').then(function(status) {
console.log(status);
page.property('content').then(function(content) {
console.log(content);
page.close();
ph.exit();
});
});
});
});
}
But i am still gettint error -
webpack:///./~/phantomjs-prebuilt/lib/phantomjs.js?:8 Uncaught Error: Cannot find module "fs"(…)
Any tips what to do ?