phantomjs具有配置的LoadImage,如何控制PhantomJS跳過下載某種資源?
,但我想要更多,
我如何控制phantomjs跳過下載某種資源,
如CSS等...
== ===
好消息: 此功能已添加。
https://code.google.com/p/phantomjs/issues/detail?id=230
要點:
page.onResourceRequested = function(requestData, request) {
if ((/http:\/\/.+?\.css/gi).test(requestData['url']) || requestData['Content-Type'] == 'text/css') {
console.log('The url of the request is matching. Aborting: ' + requestData['url']);
request.abort();
}
};
我也想知道這一點,如何讓phantomjs跳過特定資源 – iwek 2012-06-05 20:35:10
好消息:加入此功能。 – atian25 2013-01-05 07:53:34
@ user2864740爲什麼將它編輯到問題中而不作爲答案發布? – 2014-08-14 08:07:32