Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.
This repository was archived by the owner on May 30, 2023. It is now read-only.

PhantomJS does not follow some redirects #10389

@ariya

Description

@ariya

ctvo...@gmail.com commented:

Version of PhantomJS: Version 1.3.0 "Water Lily".

What steps will reproduce the problem?

  1. I run from console:

DISPLAY=:0 timeout 25 /root/phantomjs/bin/phantomjs --ignore-ssl-errors=yes /root/phantomjs/rasterize202x152.js www.chow-chow.hu /var/thumbnails/thumbfile.jpg
or:
DISPLAY=:0 timeout 25 /root/phantomjs/bin/phantomjs --ignore-ssl-errors=yes /root/phantomjs/rasterize202x152.js http://hfv-speyer.de /var/thumbnails/thumbfile.jpg

  1. /root/phantomjs/rasterize202x152.js listing:
    var page = new WebPage(),
    address, output, size, rc=0;
    page.settings.userAgent = 'Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/7.0';

if (phantom.args.length < 2 || phantom.args.length > 3) {
console.log('Usage: rasterize.js URL filename');
phantom.exit();
} else {
address = phantom.args[0];
output = phantom.args[1];
page.viewportSize = { width: 1024, height: 768 }
page.open(address, function (status) {
if (status == 'fail') {
console.log('Unable to load the address! ' + address);
phantom.exit();
console.log('Unable to load the address! ' + address);
} else {
window.setTimeout(function () {
page.clipRect = { top: 0, left: 0, width: 990, height: 745 };
page.render(output);
console.log(status);
phantom.exit();
}, 200);
}

});

}

What is the expected output? What do you see instead?
I expected to get JPEG thumbnail in /var/thumbnails/thumbfile.jpg but no file creates. For chow-chow.hu I get "success" message, and no error is shown. For hfv-speyer.de I get "Unable to load the address!" error message.

Which operating system are you using?
Debian GNU/Linux 2.6.32-5-686

Did you use binary PhantomJS or did you compile it from source?
Compiled from the source.

Please provide any additional information below:

It seems that PhantomJS can`t follow redirects like that on this websites: http://www.chow-chow.hu ( redirects to http://www.chow-chow.hu/start.php ) and http://hfv-speyer.de (redirects to http://www.hfv-speyer.de/js-start.htm)
Many other websites are rendering well the same way at my server.

Great thanks for developers for such awesome project! I really appreciate your work.

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #389.
🌟   13 people had starred this issue at the time of migration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions