href » PhantomJS
PhantomJS is a command line tool that gives you a headless browser stack. It uses WebKit under the hood, and allows you to do everything from JavaScript testing to page rendering, all driven via JavaScript, like so:
// Log Twitter status
if (phantom.state.length === 0) {
phantom.state = 'tweets';
phantom.open('http://mobile.twitter.com/noonat');
} else {
var list = document.querySelectorAll('span.status');
for (var i = 0; i < list.length; ++i) {
console.log((i + 1) + ': ' + list[i].innerHTML.replace(/<.*?>/g, ''));
}
phantom.exit();
}