onResourceTimeout
Introduced: PhantomJS 1.2
This callback is invoked when a resource requested by the page timeout according to settings.resourceTimeout
. The only argument to the callback is the request
metadata object.
The request
metadata object contains these properties:
id
: the number of the requested resourcemethod
: http methodurl
: the URL of the requested resourcetime
: Date object containing the date of the requestheaders
: list of http headerserrorCode
: the error code of the errorerrorString
: text message of the error
Examples
var webPage = require('webpage');
var page = webPage.create();
page.onResourceTimeout = function(request) {
console.log('Response (#' + request.id + '): ' + JSON.stringify(request));
};