How to use jQuery with phantomjs <p>I'm trying to do a simple test of jQuery with phantomjs:</p> <pre><code>var url = 'http://www.google.com/'; var page = require('webpage').create(); page.open(url, function () { page.injectJs('jquery.min.js'); page.evaluate(function () { console.log($('title').text()); }); phantom.exit() }); </code></pre> <p>This should print out the title, but instead nothing happens. Can somebody tell me what's wrong?</p>