By default, console messages rated on the page are not displayed in the PhantomJS console.
When you execute code under page.evaluate(...) , this code executes in the context of the page. Therefore, when you have console.log((i + 1) + ":" + list[i].innerText); , it is registered in the browser itself without a browser, and not in PhantomJS.
If you want all console messages to be sent along with PhantomJS itself, after opening the page, use the following:
page.onConsoleMessage = function (msg) { console.log(msg); };
page.onConsoleMessage launched whenever you type on the console from inside the page. With this callback, you ask PhantomJS to echo the message to your standard output stream.
For reference, your final code will look (this prints successfully for me):
var page = require('webpage').create(); page.open('https://angel.co/startups', function(status) { page.onConsoleMessage = function (msg) { console.log(msg); }; if (status !== 'success') { console.log('Unable to access network'); } else { page.evaluate(function() { var list = document.querySelectorAll('div.resume'); for (var i = 0; i < list.length; i++){ console.log((i + 1) + ":" + list[i].innerText); } }); } phantom.exit(); });
source share