Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Casperjs status fail on a Webpage

Access to the link https://disqus.com/profile/login/ from Casperjs keeps returning the following

[warning] [phantom] Loading resource failed with status=fail: https://disqus.com/profile/login/

ensnare.js

var casper = require("casper").create({
    verbose: true,
    logLevel: "debug"
});

casper.options.timeout = 15000;

casper.start("https://disqus.com/profile/login/", function() {
    this.echo("YES!", "GREEN_BAR");
    this.echo(this.getTitle());
});

casper.run();

config.json

{"ignoreSslErrors": true, "cookiesFile": "biscuit", "maxDiskCacheSize": 1000, "diskCache": true}

Please be informed that I changed "ignoreSslErrors" to false but it didn't work.

Calling the script from the terminal

./phantomjs --config=config.json casperjs/bin/bootstrap.js --casper-path=casperjs --cli ensnare.js

Screenshot

enter image description here How go I about solving this problem? I am able to access other pages without issues.

like image 988
iChux Avatar asked Mar 17 '14 17:03

iChux


2 Answers

try this (it helped me on Mac OS X):

casperjs --debug=yes --ignore-ssl-errors=true --ssl-protocol=any XYZ.j

Where XYZ.js is your file.

like image 109
PrzeoR Avatar answered Jan 03 '23 18:01

PrzeoR


All I needed to do was to have set "sslProtocol": "any" in the config.json file that I used. A proper way to set it can be found in my answer to this question.

like image 42
iChux Avatar answered Jan 03 '23 17:01

iChux