Skip to content

Instantly share code, notes, and snippets.

@cou929
Created December 12, 2012 00:11
Show Gist options
  • Save cou929/4263636 to your computer and use it in GitHub Desktop.
Save cou929/4263636 to your computer and use it in GitHub Desktop.
phantomjs でそのページから出されているリクエストをキャプチャする (onResourceRequested イベントのテスト)
var page = require('webpage').create();
page.onResourceRequested = function(request) {
console.log('Request (#' + request.id + '): ' + request.url);
};
page.open(phantom.args[0] || 'http://google.com', function() {
console.log('loaded');
phantom.exit(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment