A
A
Alexander2015-07-06 17:17:50
JavaScript
Alexander, 2015-07-06 17:17:50

Why is phantomjs not working?

Screenshot: with installation (no errors), with webpack --hot ( why several WARNING? ) and directory listing where phantomjs seems to be going
45813615e1ee8fc8c6ab2aa7f29c4284.png
phantomjs in the console does not find such a command despite the global installation.
webpack.config.js

module.exports = {
  entry: './src/main.js',
  output: {
    filename: 'dist.js'
  },
  module: {
    loaders: [
      { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
      { test: /\.json$/, loader: 'json'}
    ]
  },
  target: "node"
};

main.js
import phantom from 'phantom';
//...
    phantom.create(function (ph) {
      ph.createPage(function (page) {
        page.open("http://www.google.com", function (status) {
          console.log("opened google? ", status);
          /*page.evaluate(function () { return document.title; }, function (result) {
            console.log('Page title is ' + result);
            ph.exit();
          });*/
        });
      });
    });
  }
});

Help to find out the reason please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Kustikov, 2015-07-16
@art1z

Somehow the question is poorly worded.
Usually phantom under Windows is downloaded with a ready-made executable ( https://bitbucket.org/ariya/phantomjs/downloads/ph... ) and works fine without assembly. It has nothing to do with node.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question