PhantomJS无法加载跨域图像 [英] PhantomJS fail to load crossdomain image

查看:381
本文介绍了PhantomJS无法加载跨域图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的命令行:



This is my command line:

./phantomjs/bin/phantomjs --web-security=no --ssl-protocol=any --load-images=yes test.js  "https://somelinkwithimages.com"



test.js的来源一如既往:


Source for test.js is as blow:

var page = require('webpage').create();
var system = require('system');
var address;
if (system.args.length === 1) {
  phantom.exit(1);
}
address = system.args[1];
page.onResourceError = function(resourceError) {
  console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
};
page.open(address, function(status) {
    if(status === 'success' ){
        var title = page.evaluate(function() {
        return document.title;
        });
    }
    if (status !== 'success') {
        console.log("ERROR_PAGE_LOADING address loading failure");
        phantom.exit(ERROR_PAGE_LOADING);
    }
    else {
        console.log("seems like working");
        phantom.exit();
    }
});
console.log("Something is happening");



我猜,我在命令中遗漏了一些东西。


I guess, I am missing something in the command.

推荐答案

找到原因。它的phantomjs的错误。它的创建错误与内存有关
Found the reason. Its phantomjs's bug. Its creating error related to memory


这篇关于PhantomJS无法加载跨域图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆