我正在尝试查找热门网站中使用的javascript库版本。
使用phantomjs.exe我能够找到jquery的信息。但我不知道如何为其他Javascript库扩展它,如angular,ninject,mochajs,reactjs和nodejs
以下是http://phantomjs.org/download.html
中phanotomjs.exe的链接我附加了用于jquery的文件。
var page = require('webpage').create(),
system = require('system'),
address;
if (system.args.length === 1) {
console.log('Usage: libdetect.js url');
phantom.exit(1);
}
page.settings.loadImages = false;
address = system.args[1];
console.log('Loading', address, '...');
page.open(address, function (status) {
if (status !== 'success') {
console.log('ERROR: Unable to load', address);
phantom.exit();
} else {
setTimeout(function () {
var jQueryVersion;
jQueryVersion = page.evaluate(function () {
return (typeof jQuery === 'function') ? jQuery.fn.jquery : undefined;
});
if (jQueryVersion) {
console.log('jQuery', jQueryVersion);
} else {
console.log('This site does not use jQuery.');
}
phantom.exit();
}, 2000);
}
});
答案 0 :(得分:0)
使用angularjs
版本
angular.version
使用nodejs
版本
node -v
或者
node --version