1.0.2 • Published 8 years ago

creepy-phantomjs-runner v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Build Status

creepy-phantomjs-runner

PhantomJS adapter for creepy web downloader.

Install

$ npm install creepy-phantomjs-runner --save

Usage

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