Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
taking phantomjs for a test drive
// http://www.phantomjs.org/
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
console.log('[phantomjs] Loading page...');
page.open('http://blog.founddrama.net/', function(status){
if (status !== 'success') {
console.log('could not retrieve!');
} else {
page.evaluate(function(){
console.log('[phantomjs] Querying for post titles...');
var list = Array.prototype.slice.call(document.querySelectorAll('h2 > a[rel="bookmark"]'), 0);
console.log('[phantomjs] ' + list.length + ' post titles:');
list.forEach(function(el){
console.log(' ' + el.innerHTML.replace(/<.*?>/g, ''));
});
});
}
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.