// 网络监听
//url='http://www.realrace.cn/';
url = 'https://api.47ks.com/webcloud/?v=http%3a%2f%2fm.pptv.com%2fshow%2ficee3NJwCcrATkfk.html';
var page = require('webpage').create();
page.captureContent = ['/config/webmain.php', '/config/webmain.php'];
page.customHeaders = {
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
//"Referer":"http://wiki.xiaodutv.com/display/~changyanlong/tmp"
"Referer":url
};
page.onResourceRequested = function(request) {
console.log('[Start_Request] ' + JSON.stringify(request, undefined, 4) + '[END_Request]');
};
page.onResourceReceived = function(response) {
console.log('[Get_Receive] ' + JSON.stringify(response, undefined, 4) + '[END_Receive]');
};
//page.open(url);
page.open(url, function (status) {
var content = page.content;
console.log('Content: ' + content);
phantom.exit();
});
网友评论