title: Taking reliable screenshots of websites? Phantomjs and Casperjs both return empty screen shots on some websites
body: <p>Open a web page and take a screenshot.</p>
  <p>Using ONLY phantomjs: (this is a simple script, in fact it is the example script used in their docs. <a href="http://phantomjs.org/screen-capture.html" rel="noreferrer">http://phantomjs.org/screen-capture.html</a></p>
  <pre><code>var page = require('webpage').create();
  page.open('http://github.com/', function() {
    page.render('github.png');
    phantom.exit();
  });
  </code></pre>
  <p>Problem is that for some websites (like github) funny enough are somehow detecting and not serving phantomjs and nothing is being rendered. Result is <code>github.png</code> is a blank white png file.</p>
  <p>Replace github with say: &quot;google.com&quot; and you get a nice (proper) screenshot as is intended.</p>
  <p>At first I thought this was a Phantomjs issue so I tried running it through Casperjs with:</p>
  <pre><code>casper.start('http://www.github.com/', function() {
      this.captureSelector('github.png', 'body');
  });
  
  casper.run();
  </code></pre>
  <p><em>But I get same behavior as with Phantomjs.</em></p>
  <p>So I figured ok this is most likely a user agent issue. As in: Github sniffs out Phantomjs and decides not to show the page. So I set the user agent like below <em>but that still didn't work.</em></p>
  <pre><code>var page = require('webpage').create();
  page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36';
  page.open('http://github.com/', function() {
    page.render('github.png');
    phantom.exit();
  });
  </code></pre>
  <p>So then I tried to parse the page and apparently some sites (again like github) don't appear to be sending anything down the wire.</p>
  <p>Using casperjs I tried to print the title. And for google.com I got back <code>Google</code> but for github.com I got back bupkis. Example code:</p>
  <pre><code>var casper = require('casper').create();
  
  casper.start('http://github.com/', function() {
      this.echo(this.getTitle());
  });
  
  casper.run();  
  </code></pre>
  <p>The same as above also produces the same result in purely phantomjs.</p>
  <h1>Update:</h1>
  <p>Could this be a timing issue? Is github just super slow? I doubt it but lets test anyway..</p>
  <pre><code>var page = require('webpage').create();
  page.open('http://github.com', function (status) {
      /* irrelevant */
     window.setTimeout(function () {
              page.render('github.png');
              phantom.exit();
          }, 3000);
  });
  </code></pre>
  <p>And the result is still bupkis. So no it's not a timing issue.</p>
  <ol>
  <li><strong>How are some sites like github blocking phantomjs?</strong></li>
  <li><strong>How can we reliably take screenshots of ALL webpages? Required to be fast, and headless.</strong></li>
  </ol>