Hello,
I just installed WWW::Mechanize::PhantomJS and am trying to run the first sample program I found here:
http://search.cpan.org/~corion/WWW-Mechanize-PhantomJS-0.08/lib/WWW/Mechanize/PhantomJS.pm

Here is the actual code:


#!/usr/bin/perl -w use strict; use WWW::Mechanize::PhantomJS; my $mech = WWW::Mechanize::PhantomJS->new(); $mech->get('http://google.com'); $mech->eval_in_page('alert("Hello PhantomJS")'); my $png= $mech->content_as_png();

When I try to run it I get the following error:


./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.

FWIW, line 131 of PhantomJS.pm is as follows:


$options{ pid } = open my $fh, $cmd

and $cmd is:


my $cmd= "| $options{ launch_exe } $options{ launch_ghostdir } @{ $opt +ions{ launch_arg } }";

Does anyone know what the problem could be?


In reply to WWW::Mechanize::PhantomJS - can't exec "phantomjs" by Special_K

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.