I am new to using Phantom.js . I am trying to get the response of a click event via Phantom.js. But i am unable to get. i just want to know how one can get the response of any event like click, submit or other.
I tried to get the response from google page as enter some value on the google text box and than click on search i just want to print the response coming from google for that particular search. Or some example that print the response of any click button via its id or class.
Below is my code:-
var page = require('webpage').create();
page.open('http://www.google.com', function() {
console.log('Running of phantom.js')
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
page.evaluate(function(){
$('#lst-ib').val('hello');
$("form[name='f']").submit(); // i want to print this response
//console.log(page.content);
})
phantom.exit();
})
});
Any help would be appreciated.
Thanks!