Created
December 12, 2012 00:11
-
-
Save cou929/4263636 to your computer and use it in GitHub Desktop.
phantomjs でそのページから出されているリクエストをキャプチャする (onResourceRequested イベントのテスト)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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