Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    $mech->eval_in_page('alert("Hello PhantomJS")');
    my $png= $mech->content_as_png();
    
  2. or download this
    ./phantomjs_test.pl 
    Can't exec "phantomjs": No such file or directory at /usr/lib/perl5/si
    +te_perl/5.14/WWW/Mechanize/PhantomJS.pm line 131.
    Couldn't launch [| phantomjs /usr/lib/perl5/site_perl/5.14/WWW/Mechani
    +ze/PhantomJS/ghostdriver/main.js --port=8910 --logLevel=OFF]: No such
    + file or directory / 0 at /usr/lib/perl5/site_perl/5.14/WWW/Mechanize
    +/PhantomJS.pm line 131.
    
  3. or download this
    $options{ pid } = open my $fh, $cmd
    
  4. or download this
    my $cmd= "| $options{ launch_exe } $options{ launch_ghostdir } @{ $opt
    +ions{ launch_arg } }";