-3

I write a Perl script using WWW::Mechanize::PhantomJS to get the content of the page https://www.landata.vic.gov.au/ but the content is empty.

It seems there is something wrong with SSL Certificate, could anyone help me fix this problem?

Here is the code I extracted from my program:

use strict;
use warnings;

use CGI qw(:cgi-lib :standard);
use WWW::Mechanize::PhantomJS;
use Utility;
use JSON;
#use DBI;
use DateTime;
use DateTime::TimeZone;

#Create PhantomJs object

my $website = WWW::Mechanize::PhantomJS -> new(
    launch_arg => ['ghostdriver/src/main.js']
);

#Launch the website
$website -> get(https://www.landata.vic.gov.au/);

#Get content of the page

print $website->content( format => 'html' );
Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339

1 Answers1

2

PhantomJs by default tries SSL 3.0 and your target site does not support SSL 3.0. Try to override this default behavior by adding --ssl-protocol=any with phantomjs_arg:

my $website = WWW::Mechanize::PhantomJS -> new(
    phantomjs_arg => [ '--ssl-protocol=any' ],
    launch_arg => ['ghostdriver/src/main.js']
);
Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172