[javascript]代码库
// JavaScript source code
system = require('system')
address = system.args[1];//获得命令行第二个参数 接下来会用到
//console.log('Loading a web page');
var page = require('webpage').create();
var url = 'XXX';//要截屏的地址
//console.log(url);
page.open(url, function (status) {
//Page is loaded!
if (status !== 'success') {
console.log('Unable to post!');
} else {
//console.log(page.content);
//var title = page.evaluate(function() {
// return document.title;//示范下如何使用页面的jsapi去操作页面的 www.oicqzone.com
// });
//console.log(title);
console.log('ok');
//page.render('D:\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin\test.png');
page.render('d:/phantomjs/test05.png', { format: 'png', quality: '100' });
}
phantom.exit();
});