phantomjs note
来源:互联网 发布:windows xp一键重装 编辑:程序博客网 时间:2024/05/29 19:24
useful likns:
phantomjs
cnblogs
Example1:
test.js:
console.log('Hello, world!');phantom.exit();
command:
phantomjs test.js
Example2:
test.js
var page = require('webpage').create();page.open('http://www.cnblogs.com/ziyunfei/archive/2012/09/28/2707356.html', function () { page.render('google.png'); phantom.exit();});command:
phantomjs test.jstest_loadtime.js
var page = require('webpage').create(), t, address;t = Date.now();address = 'http://google.com';page.open(address, function (status) { if (status !== 'success') { console.log('FAIL to load the address'); } else { t = Date.now() - t; console.log('Loading time ' + t + ' msec'); } phantom.exit();});command:
phantomjs test_loadtime.js
Example3;
var page = require('webpage').create();var url = 'http://www.google.com';page.open(url, function (status) { var title = page.evaluate(function () { return document.title; }); console.log('Page title is ' + title);});
Example4:
var page = require('webpage').create();var url = 'http://www.google.com';page.onResourceRequested = function (request) { console.log('Request ' + JSON.stringify(request, undefined, 4));};page.onResourceReceived = function (response) { console.log('Receive ' + JSON.stringify(response, undefined, 4));};page.open(url);
0 0
- phantomjs note
- phantomjs
- phantomjs
- phantomjs
- PhantomJS
- PhantomJS
- phantomjs
- phantomjs
- PhantomJS
- phantomjs
- note
- note
- NOTE
- note
- Note
- note
- note
- Note
- proj 4 大地坐标系转ecef
- synchronized和Lock
- mac 安装xapian
- 【VBA研究】Excel VBA利用ADODB访问数据库使用小结
- MS Chart Control - X轴 项目超9项时 Label显示不完全
- phantomjs note
- A Simple Task
- 一些平台无关的整型类型,int8_t,uint8_t....
- java将文件打包成ZIP压缩文件的工具类实例
- 自定义控件之选择框CheckerWithChild
- Java异常的捕获和抛出
- Java多线程(三)、线程同步
- MulticastSocket 使用
- 9path图片作为背景导致其下控件不能显示