Added a page.post function
I needed to access a page using the post action for authentication, so I added a page.post function that calls Phantom's open(url,'post',data,callback). I thought I could share it in case someone else needs it.
Definition : page.post(url, data[, callback]) url : where to post data : html encoded string with the body of the request callback : callback function (optional)
Example code : var phantom=require('node-phantom'); phantom.create(function(error,ph){ ph.createPage(function(err,page){ var data = "[email protected]&pass=my_pass"; page.post('http://domain.com/login',data,function(err,status){ //Do stuff here }); }); });
I need this badly. :+1:
Need this.
ph.createPage(function(err,page){ // why does my application stop here , no error reported . what should I do , thanks
++please