WWW::Mechanize::PhantomJS


Speed up Selenium with PhantomJS which is a headless Webkit browser using GhostDriver and WWW::Mechanize::PhantomJS.


examples/phantom/google.pl
use strict;
use warnings;
use 5.010;

use WWW::Mechanize::PhantomJS;
my $mech = WWW::Mechanize::PhantomJS->new();
$mech->get('http://google.com');
say $mech->content;

examples/phantom/localhost.pl
use strict;
use warnings;
use 5.010;

use WWW::Mechanize::PhantomJS;
my $mech = WWW::Mechanize::PhantomJS->new();
$mech->get('http://localhost:8080/');
say $mech->content;