0

I have found some strange issue. I'm using PhantomJs v2.1.1 on Windows 7 and Ubuntu 16.04. I tried to open page https://my.avast.com and under Windows it has succeeded but on Ubuntu it has failed. Also I tried to run example .js script added to phantomjs2.1.1--.tar.gz file, e.g.

phantomjs responsive-screenshot.js https://my.avast.com png

but it has not succeeded - only images without background and with text Loading have been written.

Could you propose workaround for this situation?

My main goal is to login to avast.com page under headless linux.

soundslikeodd
  • 1,078
  • 3
  • 19
  • 32
fotrenc
  • 45
  • 6
  • `phantomjs works only on windows` usually due to an SSL error, that's why i suggest you to use the `--ignore-ssl-errors=true` command-line option, `--ssl-protocol=any --debug=true` may not be necessary, but may also be useful. –  Jan 15 '17 at 13:05
  • 1
    Exactly it has helped me to solve this problem. I have googled some informations about it and it looks like this is an old issue. Probably it will not be fixed in nearest future. – fotrenc Jan 15 '17 at 22:15

1 Answers1

1

Try to run with: --ignore-ssl-errors=true --ssl-protocol=any --debug=true

phantomjs --ignore-ssl-errors=true --ssl-protocol=any --debug=true responsive-screenshot.js https://my.avast.com png

You need to use onResourceError callback, to find out, what's going wrong.

  • 1
    Thank you very much. Failure was caused by SSL error, wich I displayed by using this [onResourceError](http://phantomjs.org/api/webpage/handler/on-resource-error.html) callback, and this is the output: `SSL Error: "The issuer certificate of a locally looked up certificate could not be found" SSL Error: "The root CA certificate is not trusted for this purpose"` Those switches helped me to display this page. I found that this error occured even in 2013. It is caused by some modules used in Linux version of PhantomJS? – fotrenc Jan 15 '17 at 22:00