首页 > Web开发 > 详细

phantomjs-使用系统命令system

时间:2017-02-23 14:23:57      阅读:514      评论:0      收藏:0      [点我收藏+]
var webpage = require(‘webpage‘);
var page = webpage.create();
var system = require(‘system‘);
var t,address;

if(system.args.length === 1){
	console.log(‘Usage:page.js <some url>‘);
	phantom.exit();
}

t = Date.now();
address = system.args[1]
page.open(address,function(s){
	if (s == "success") {
		t = Date.now() - t;
		console.log(‘loading ‘ + t);
	}else{
		console.log(‘fail‘);
	}

	phantom.exit();
});


本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1900444

phantomjs-使用系统命令system

原文:http://suyanzhu.blog.51cto.com/8050189/1900444

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!