{"_id":"node-phantom","_rev":"136962","name":"node-phantom","description":"bridge between node.js and PhantomJS","dist-tags":{"latest":"0.2.5"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"time":{"modified":"2021-06-03T11:21:58.000Z","created":"2012-07-06T22:39:32.084Z","0.2.5":"2013-10-18T19:25:22.841Z","0.2.4":"2013-10-15T19:56:00.801Z","0.2.3":"2013-05-22T09:26:43.058Z","0.2.2":"2013-05-22T08:53:41.716Z","0.2.1":"2013-02-01T11:08:22.465Z","0.2.0":"2013-01-11T10:36:54.653Z","0.1.2":"2012-09-07T09:50:49.079Z","0.1.1":"2012-08-20T09:35:04.795Z","0.1.0":"2012-07-06T22:39:32.084Z"},"users":{"rajkumarbe":true,"eslivinski":true,"vb078":true,"alien":true,"abouleinein":true,"andr":true,"azevedo":true,"hack21":true},"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"versions":{"0.2.5":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.2.5","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"mocha"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"mocha":"*","pngjs":"0.4.0"},"optionalDependencies":{},"engines":{"node":"*"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/alexscheelmeyer/node-phantom/issues"},"_id":"node-phantom@0.2.5","dist":{"shasum":"e330c3c4f6e7564aeec838a61afb0bd70e9c17ab","size":11743,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.2.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.2.5.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1382124322841,"_cnpm_publish_time":1382124322841,"_hasShrinkwrap":false},"0.2.4":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.2.4","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"mocha"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"mocha":"*","pngjs":"0.4.0"},"optionalDependencies":{},"engines":{"node":"*"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/alexscheelmeyer/node-phantom/issues"},"_id":"node-phantom@0.2.4","dist":{"shasum":"64f885a41564107ecf05162b444676c7e110fe22","size":11682,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.2.4.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1381866960801,"_cnpm_publish_time":1381866960801,"_hasShrinkwrap":false},"0.2.3":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.2.3","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_id":"node-phantom@0.2.3","dist":{"shasum":"5c291d9374599647d8310708d1f0bd35c0cc62a1","size":10432,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.2.3.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1369214803058,"_cnpm_publish_time":1369214803058,"_hasShrinkwrap":false},"0.2.2":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.2.2","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_id":"node-phantom@0.2.2","dist":{"shasum":"79068da29a1aab8b0d97b3a4b204bef272ea4244","size":10302,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.2.2.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1369212821716,"_cnpm_publish_time":1369212821716,"_hasShrinkwrap":false},"0.2.1":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.2.1","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_id":"node-phantom@0.2.1","dist":{"shasum":"46a8d33b838103738ef161f9a801263dd1b580fc","size":10144,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.2.1.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1359716902465,"_cnpm_publish_time":1359716902465,"_hasShrinkwrap":false},"0.2.0":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.2.0","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_id":"node-phantom@0.2.0","dist":{"shasum":"27c8198a1bdedd7723b6e0538525e50d594c0ae0","size":9976,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.2.0.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1357900614653,"_cnpm_publish_time":1357900614653,"_hasShrinkwrap":false},"0.1.2":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.1.2","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_id":"node-phantom@0.1.2","dist":{"shasum":"cda4368e9b3df897278116013f10550ad1eb894b","size":8615,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.1.2.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1347011449079,"_cnpm_publish_time":1347011449079,"_hasShrinkwrap":false},"0.1.1":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.1.1","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_id":"node-phantom@0.1.1","dist":{"shasum":"4857b2290a942d6c5b76dae35744b252032bd0ab","size":7547,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.1.1.tgz"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1345455304795,"_cnpm_publish_time":1345455304795,"_hasShrinkwrap":false},"0.1.0":{"author":{"name":"Alex Scheel Meyer","url":"http://www.linkedin.com/in/alexscheelmeyer"},"name":"node-phantom","description":"bridge between node.js and PhantomJS","version":"0.1.0","homepage":"https://github.com/alexscheelmeyer/node-phantom","repository":{"type":"git","url":"git://github.com/alexscheelmeyer/node-phantom.git"},"main":"node-phantom.js","scripts":{"test":"expresso"},"dependencies":{"socket.io":">=0.9.6"},"devDependencies":{"socket.io":">=0.9.2"},"optionalDependencies":{},"engines":{"node":"*"},"_npmUser":{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"},"_id":"node-phantom@0.1.0","_engineSupported":true,"_npmVersion":"1.1.19","_nodeVersion":"v0.6.16","_defaultsLoaded":true,"dist":{"shasum":"bdf906763b7ed5639fad906e9fc51040ad3e0f4a","size":7481,"noattachment":false,"key":"/node-phantom/-/node-phantom-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/node-phantom/download/node-phantom-0.1.0.tgz"},"maintainers":[{"name":"alexscheelmeyer","email":"alexscheelmeyer@gmail.com"}],"directories":{},"publish_time":1341614372084,"_cnpm_publish_time":1341614372084,"_hasShrinkwrap":false}},"readme":"Node-phantom\n---------------\n\nThis is a bridge between [PhantomJs](http://phantomjs.org/) and [Node.js](http://nodejs.org/).\n\nIt is very much similar to the other bridge available, [PhantomJS-Node](https://github.com/sgentle/phantomjs-node), but is different in a few ways:\n\n  - Way fewer dependencies.\n  - API has the idiomatic error indicator as first parameter to callbacks.\n  - Uses plain Javascript instead of Coffeescript.\n\n\nRequirements\n------------\nYou will need to install PhantomJS first. The bridge assumes that the \"phantomjs\" binary is available in the PATH.\n\nThe only other dependency for using it is [socket.io](http://socket.io/).\n\nFor running the tests you will need [Expresso](http://visionmedia.github.com/expresso/).\n\n\nInstalling\n----------\nFor now you will need to manually install socket.io and node-phantom. Npm package to be arriving shortly.\n\n\nUsage\n-----\nYou can use it pretty much like you would use PhantomJS-Node, for example this is an adaptation of a [web scraping example](http://net.tutsplus.com/tutorials/javascript-ajax/web-scraping-with-node-js/) :\n\n```javascript\nvar phantom=require('node-phantom');\nphantom.create(function(err,ph) {\n  return ph.createPage(function(err,page) {\n    return page.open(\"http://tilomitra.com/repository/screenscrape/ajax.html\", function(err,status) {\n      console.log(\"opened site? \", status);\n      page.injectJs('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', function(err) {\n        //jQuery Loaded.\n        //Wait for a bit for AJAX content to load on the page. Here, we are waiting 5 seconds.\n        setTimeout(function() {\n          return page.evaluate(function() {\n            //Get what you want from the page using jQuery. A good way is to populate an object with all the jQuery commands that you need and then return the object.\n            var h2Arr = [],\n            pArr = [];\n            $('h2').each(function() {\n              h2Arr.push($(this).html());\n            });\n            $('p').each(function() {\n              pArr.push($(this).html());\n            });\n\n            return {\n              h2: h2Arr,\n              p: pArr\n            };\n          }, function(err,result) {\n            console.log(result);\n            ph.exit();\n          });\n        }, 5000);\n      });\n\t});\n  });\n});\n```\n\nYou can also have a look at the test folder to see some examples of using the API.\n\nOther\n-----\nMade by Alex Scheel Meyer. Released to the public domain.\n\n","_attachments":{},"readmeFilename":"README.md","homepage":"https://github.com/alexscheelmeyer/node-phantom","bugs":{"url":"https://github.com/alexscheelmeyer/node-phantom/issues"}}