1

we´d like to use phantomjs to connect to a our internal documentation system and print the source code of the website for further usage.

The script is basically from the examples:

> var page = require('webpage').create(),
>     system = require('system');
> 
> page.open('https://servername.domain.net/web/topicname?refresh=on',
> function () {
>     console.log(page.content);
>     phantom.exit();  });

We downloaded the binary package from the phantomjs homepage and extracted it to our debian jessie server and executing the script:

root@servername:/usr/local/share/phantomjs-2.1.1-linux-x86_64/examples# phantomjs script.js --ssl-protocol=any --ignore-ssl-errors=true

Unfortunately we only get a empty html source:

<html><head></head><body></body></html>

If we are executing this on one of your windows client pc´s with the windows binary of phantomjs, it works smoothly.

The apache access log dont show any accesses when the phantomjs script get executed from the debian server. (the error.log with debug enabled show atleast a established ssl connection however)

Is there anything i am missing ?

Any feedback is appreciated!

Thanks

2
  • Try with phantomjs 1.9.8 Commented Feb 4, 2016 at 10:47
  • What do you get with wget or curl? Commented Feb 4, 2016 at 10:49

1 Answer 1

2

It's the SSL certificate issue. You included the correct switches to ignore ssl errors, but not at the right place. PhantomJS setting switches are to go before the script path:

phantomjs --ssl-protocol=any --ignore-ssl-errors=true script.js
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.