Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: WWW::Mechanize::PhantomJS - can't exec "phantomjs"

by Special_K (Monk)
on Sep 19, 2014 at 04:34 UTC ( [id://1101145]=note: print w/replies, xml ) Need Help??


in reply to WWW::Mechanize::PhantomJS - can't exec "phantomjs"

After some digging, I found the solution. It turns out that while cygwin can call windows executables, the POSIX-style pathnames that cygwin uses (e.g. /home/user/hello.js) must first be converted to Windows-compatible paths (e.g. C:\cygdrive\cygwin64\home\user\hello.js) using the cygpath utility. Here is the actual code I had to use:

my $mech = WWW::Mechanize::PhantomJS->new( launch_ghostdir => '"`cygpath -w /usr/lib/perl5/site_perl/5.14/WWW +/Mechanize/PhantomJS/ghostdriver/main.js`"', );


I'm not sure why I need both double quotes and backticks to make it work, but that's what the example I found used, so I went with it. I decided to update this post because I hate searching and finding the exact issue I am having with no solution posted. Hopefully someone finds this information useful someday.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1101145]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found