Yogesh Unavane
Yogesh Unavane

Reputation: 265

PhantomJS status 'fail' for CSS file

I am getting Status=fail when requesting this CSS file

PhantomJS version = 2.0.0 Link : http://www.nfm.com/Content/MainMasterCss_C4BA203F2F5805AA4E787B1466B7F298.css

Even debugging not helping much.

console.log('Loading a web page');
var page = require('webpage').create();
var url = 'http://www.nfm.com/Content/MainMasterCss_C4BA203F2F5805AA4E787B1466B7F298.css';
page.open(url, function (status) {

    console.log(status);

    page.render('sample.jpg');

    phantom.exit();
});

I am actually trying to load an HTML page which has this CSS, 0KB JPG is generated if I make absolute path for that CSS. No resourceError is thrown for this CSS.

Upvotes: 0

Views: 328

Answers (1)

Vitaly Slobodin
Vitaly Slobodin

Reputation: 1359

PhantomJS doesn't support any content except HTML (XML). You can't open non-HTML page directly.

We have following issues to track this bug:

Upvotes: 2

Related Questions