casperjs does not find phantomjs

phantomjs-prebuilt
install phantomjs
install casperjs
node casper
phantomjs download
casperjs download file
phantomjs npm
casper scraping

I've downloaded the latest version of casperjs (1.03) and phantomjs (1.9.2).

So I took this little simple script from the casper page:

var casper = require('casper').create({
    verbose: true,
    logLevel: "debug"
});
var casper = new require('casper').Casper();

and when I try to run it I get the following error:

noname:phantomjs-1.9.2 Tom$ casperjs/bin/casperjs tipico2.js 
Fatal: [Errno 2] No such file or directory; did you install phantomjs?

So, this is my directory structure:

phantomjs-1.9.2/ <-- the folder containing phantomjs
phantomjs-1.9.2/casperjs/ <-- a subfolder containting casperjs

Why does it not work?

The solution is actually very simple. Just export the path where the binary of phantomjs is. In my case this is /Users/Tom/Downloads/phantomjs-1.9.2/bin, hence

export PATH=$PATH:/Users/Tom/Downloads/phantomjs-1.9.2/bin

Resolving CasperJS installation issues with PhantomJS not able to , bash_profile) so that PhantomJS can be 'found'. Save the amended . bash_profile, exit the current shell and open a new one. Now if you try running your CasperJS script you should experience no problems with PhantomJS being unable to be found. But the regular problems are because casperjs is not installed properly as system variable. Or php-casperjs cannot find the path to casper or it could be that casperjs cannot find the path to phantomjs.

Faced the same problem when installed casper with npm globally on osx. At first I've set environment variable PHANTOMJS_EXECUTABLE to path where phantomjs was installed (it's usually /usr/local/lib/node_modules/casperjs/node_modules/phantomjs/lib/phantom/bin/phantomjs phantomjs) with

export PHANTOMJS_EXECUTABLE=/usr/local/lib/node_modules/casperjs/node_modules/phantomjs/lib/phantom/bin/phantomjs phantomjs

this helped only partially as I still got an error like there's no file nor folder /usr/local/bin/phantomjs, so I've just created symlink and pointed it to real binary folder with

ln -s /usr/local/lib/node_modules/casperjs/node_modules/phantomjs/lib/phantom/bin/phantomjs /usr/local/bin/phantomjs

hope this will help someone :)

casperjs does not find phantomjs - path - php, I've downloaded the latest version of casperjs (1.03) and phantomjs (1.9.2). So I took this little simple script from the casper page: var casper  Hello, I'm having trouble running the example code. I installed phantomjs and casperjs. I installed php-casperjs And when I run the example I get: Fatal error: Class 'Browser\Casper' not found in C:\wamp\www\crawler\ajax.php on line 5 Wh

For OS X:

brew install casperjs --devel

brew install phantomjs

and it will works

"Fatal: [Errno 2] No such file or directory; did you install phantomjs , env file and still no luck to get it up and running along with Casper. After that i found that phantom was not being pushed up so i added it to the  Your server's response may contain the correct data, but since it returns a URL as XML, PhantomJS cannot parse this correctly. This is why there is an error shown as an HTML page. You should specifically use __utils__.sendAJAX to download the content (in JavaScript): casper.post = function(url, data){ return this.evaluate(function(targetURL){

If you are getting this error in PHP, place this above your exec:

<?php
    putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
?>

Where path /usr/local/bin/phantomjs is the path to your phantomjs install. You can get this by typing which phantomjs into terminal for example.

Can not find CasperJS · Issue #25 · alwex/php-casperjs · GitHub, I installed phantomjs and casperjs. I installed php-casperjs And when I run the example I get: Fatal error: Class 'Browser\Casper' not found in  Note that all versions up to and including 1.1-beta3 do not support PhantomJS 2.0 and newer. The complete documentation for the current releases is hosted on docs.casperjs.org . CasperJS is a navigation scripting & testing utility for PhantomJS and SlimerJS (still experimental).

Solution For Windows

STEP 1 - Go to Environment Variables

Start -> Environment Variables -> Environment Variables or My PC -> Properties -> Advanced System Settings -> Environment Variables


STEP 2 - Set new PATH to your PhantomJS/bin folder

Select PATH (User or System) -> Edit

New -> Browse -> find your BIN folder in PhantomJS installation on your HDD Accept


STEP 3 - Test Your Work

Open CMD -> Type "phantomjs -v"

You should get phantomJS version number as answer in any folder in your tree.

Installing CasperJs - a journey of pain, My friends on twitter keeps telling my that CasperJs is great (“da bomb”) for CasperJs is, to my knowledge, just a wrapper around PhantomJS, I could not get it to work when I npm install casperjs so I gave up on that. The best way to find out if a certain feature is supported or not is via feature detection, for example by using a library like Modernizr. The included examples/features.js illustrates the use of Modernizr and dumps all the detected features, both supported and not supported.

Installation, To see PhantomJS API compatibility of SlimerJS, please refer to this page. rubybin/ directory has been deprecated as of 1.1-beta, and is not compatible with SlimerJS. Installation of both PhantomJS and CasperJS can be achieved using​  I opening webpages with casperjs 1.1.0 beta5 from phantomjs 2.1.1. After 87 webpage phantomjs stoped and I saw in command line:" Memory exhausted." In task manager then opened webpages from 1 to 83, memory stable increase from 50 mb to 1

[PDF] CasperJs Documentation, To see PhantomJS API compatibility of SLimerJS, please refer to this page. has been deprecated as of 1.1-beta, and is not compatible with SLimerJS. Installation of both PhantomJS and CasperJS can be achieved through Homebrew:. ariya/phantomjs is licensed under the BSD 3-Clause "New" or "Revised" License. A permissive license similar to the BSD 2-Clause License, but with a 3rd clause that prohibits others from using the name of the project or its contributors to promote derived products without written consent.

Installing PhantomJS and CasperJS on Ubuntu, Note: CoffeeScript is not natively supported in PhantomJS versions Note: As you can see, there's no need to create a casper instance in a  This led to lots of confusion and issues against CasperJS not working properly if installed through npm. Starting with 1.1.0 the installation of an engine (PhantomJS, SlimerJS) will be a real prerequisite, regardless of the installation method you choose for CasperJS.

Comments
  • You can also set an environment variable, instead of modifying your PATH. PHANTOMJS_EXECUTABLE=/Users/Tom/Downloads/phantomjs-1.9.2/bin/phantomjs
  • how can I use this evnriontemtnal variable then?
  • You need both PATH and PHANTOMJS_EXECUTABLE (as @Brian mentioned) to get this working.
  • how do I use that variable then? this PHANTOMJS_EXECTUABLE - how do I use it?
  • @ERJAN you just need to set locate phantomjs binary and then set it to PHANTOMJS_EXECUTABLE in the console. then it will be used by casper to locate phantom and work properly
  • For folks trying to use CasperJS with slimerjs (instead of phantomjs): I've gotten it to run, much like the above, by setting an equivalent environment variable SLIMERJS_EXECUTABLE=/path/to/slimerjs but also I had to pass --engine=slimerjs as an argument to the casperjs executable.
  • --devel flag doesn't seem to work, but other than that, this works on High Sierra