Onresourcerequested undefined


#1

I’m getting the following error message:
TypeError: undefined is not a function (evaluating ‘page.onResourceRequested’)

for the following js file:
var page = require(‘webpage’).create();
page.onResourceRequested(function(requestData, networkRequest) {});

onResourceRequested is undefined on the page object. What am I doing wrong?

Otherwise, phantomjs is working fine…

Phantomjs v 2.1.1


#2

Please see this