I can\'t seem to do a simple form submit.
Below is the code that I did to submit \"Test\" to the Google search form and print out the results.
var url =
It isn't sufficient to render a page immediately after "clicking". You have to give the web engine time to make whatever calls are required and execute the resulting JavaScript.
Consider the following after your call to evaluate:
window.setTimeout(
function () {
page.render( 'google.png' );
phantom.exit(0);
},
5000 // wait 5,000ms (5s)
);
By the way - the click may or may not work depending on what kind of element it is. If that doesn't work I suggest you search the Internet for how to click on a DIV or whatever type of element it happens to be (there is a technique which involves creating a mouse event).