title: Phantomjs - How to populate a form, submit and get the results?
body: <p>I can't seem to do a simple form submit. </p>
  
  <p>Below is the code that I did to submit "Test" to the Google search form and print out the results.</p>
  
  <pre><code>var url = 'http://www.google.com/',
      page = new WebPage();
  
  page.open(url, function(status) {
      if (status !== 'success')
      {
        console.log('Unable to access network');
        phantom.exit();
        return;
      }
      else
      {
          page.includeJs("//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js", function() {
              page.evaluate(function() {
                  $('#gbqfq').val("Test");
  
                  $("#gbqfba").click();
  
              });
  
              page.render('google.png');
              phantom.exit();
          });
      }
  });
  </code></pre>
  
  <p>Anyone can show me how to do this? I have looked around here and in other sites but nothing seemed to work.</p>