var page = require('webpage').create();
page.open('http://example.com', function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render('example.png');
}
phantom.exit();
});
Because I did try to use that, and it didn't like the require('webpage') because my js code said it was not aware of what "webpage" module was. That's why I researched and found that Phantom for Node wrapper link above. So should I be able to still use the vanilla PhantomJS code above here without using that wrapper?
No, you cannot use a vanilla PhantomJS script in Node.js unless you are doing so via a low-level `child_process` call. When you choose any Node.js wrapper for PhantomJS (of which there are quite a few), you MUST read that wrappers documentation to see how it works.
For example, the "phantom" module you are using:
https://www.npmjs.com/package/phantom
Most come with lots of caveats, which is not implicitly bad BUT you need to familiarize yourself with them.
Sincerely,
James M. Greene
--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs.
For more options, visit https://groups.google.com/d/optout.