[Crawl]Phantomjs传参

配合NodeJS

var system = require('system');
console.log('phantom.args:',system.args);

// test.js
var page = require('webpage').create(),
  system = require('system'),
  address;
if (system.args.length === 1) {
  phantom.exit(1);
} else {
  address = system.args[1];
  page.open(address, function (status) {
    console.log(page.content);
    phantom.exit();
  });
}

你可能感兴趣的:([Crawl]Phantomjs传参)