Passing a variable to PhantomJS via exec
I'm getting started with Grunt and wanting to pass a variable to a PhantomJS script I'm running via exec. What I want to be able to do is pass a url in for the script to take the screen capture from. Any help would be greatly appreciated, thanks! Darren Grunt script exec('phantomjs screenshot.js', function (error, stdout, stderr) { // Handle output } ); screenshot.js var page = require('webpage').create(); page.open('http://google.com', function () { page.render('google.png'); phantom.exit(); }); Cybermaxs Command-line arguments are accessible via module require('system').args (Module System )