1.0.2 • Published 10 years ago
creepy-phantomjs-runner v1.0.2
creepy-phantomjs-runner
PhantomJS adapter for creepy web downloader.
Install
$ npm install creepy-phantomjs-runner --saveUsage
var runner = require('creepy-phantomjs-runner')()
.js('/path/to/jquery.js')
.js('/path/to/analyzer.js')
.on('result', (output, url) => {
console.log('The result is: ' + output)
// The result is: Google
// (and there is a '\n' at the end)
})
.on('error', (err) => {
console.log(err)
})
runner.open('http://www.google.com')In '/path/to/analyzer.js':
console.log('creepy-phantomjs-runner:' + jQuery('#hplogo').attr('title'))Notice
Notice that, in order to distinguish with other console.log()ed message, only the log message which starts with 'creepy-phantomjs-runner:' will be output.
License
MIT