title: PhantomJS onLoadFinished not working
body: <p>I am using PhantomJS 2.1.1 to take mobile screenshots but some of them don't come out right because page isn't fully rendered.  I have tried to use the onLoadFinished event but it's not working.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var system = require('system');
  var args = system.args;
  
  var page = require('webpage').create();
  
  page.open(args[1]);
  
  page.onLoadFinished = function (status) {
  
      page.viewportSize = { width: 414, height: 736 };
  
      page.clipRect = { top: 0, left: 0, width: 414, height: 736 };
      page.render(args[2]);
      console.log(args[2]);
      phantom.exit();
  
  });
  </code></pre>
  
  <p>It just hangs and doesn't return.  I got around this by using a 2 second hard coded delay but this isn't good as I don't know every site will load in 2 seconds.</p>
  
  <p>This is hard coded delay Im using:</p>
  
  <pre><code>page.open(args[1], function () {
  
      page.viewportSize = { width: 414, height: 736 };
  
      page.clipRect = { top: 0, left: 0, width: 414, height: 736 };
  
      setTimeout(function () {
          page.render(args[2]);
          console.log(args[2]);
          phantom.exit();
      }, 2000);
  
  });
  </code></pre>
  
  <p>How do I get the code working with the proper load event?</p>