2

I am able to access Google to get a page title:

var casper = require('casper').create();
casper.start('http://google.com', function() {
    this.echo(this.getTitle());
})
casper.run();
// "Google"

But for some reason I'm not able to get the iTunes Connect page:

var casper = require('casper').create();
casper.start('https://itunesconnect.apple.com', function() {
    this.echo(this.getTitle());
})
// Undefined

How would I successfully request the above page?

Here is what I currently get:

[info] [phantom] Starting...
[info] [phantom] Running suite: 2 steps
[debug] [phantom] opening url: https://itunesconnect.apple.com/, HTTP GET
[debug] [phantom] Navigation requested: url=https://itunesconnect.apple.com/, type=Other, willNavigate=true, isMainFrame=true
[warning] [phantom] Loading resource failed with status=fail: https://itunesconnect.apple.com/
[debug] [phantom] Successfully injected Casper client-side utilities
[object Casper], currently at about:blank
[info] [phantom] Step anonymous 2/2: done in 66ms.
[info] [phantom] Done 2 steps in 86ms
David542
  • 104,438
  • 178
  • 489
  • 842
  • What version of PhantomJS do you use? Please register to the `resource.error`, `page.error`, `remote.message` and `casper.page.onResourceTimeout` events ([Example](https://gist.github.com/artjomb/4cf43d16ce50d8674fdf)). Maybe there are errors. – Artjom B. Aug 06 '15 at 19:59
  • @ArtjomB. how would I apply the above inside the `start()` function? – David542 Aug 06 '15 at 22:32

1 Answers1

1

You need to specify ssl when running the script:

casperjs --ssl-protocol=tlsv1 script.js
David542
  • 104,438
  • 178
  • 489
  • 842