admin管理员组

文章数量:1023131

I'm migrating a script from PhantomJS to CasperJS, and am wondering if Casper provides any references to the Phantom objects that it is using behind the scenes.

Phantom provides some functionality that Casper doesn't (injectJs, for example).

For pleteness' sake, here are all of Phantom's objects:

  • webpage
  • system
  • fs
  • webserver
  • child_process

By looking at the casper object's properties, I did find a reference to the webpage object (casper.page), so my particular use case is handled. I figured I would post this question anyway in case other people need access to system, fs, webserver, or child_process.

I'm migrating a script from PhantomJS to CasperJS, and am wondering if Casper provides any references to the Phantom objects that it is using behind the scenes.

Phantom provides some functionality that Casper doesn't (injectJs, for example).

For pleteness' sake, here are all of Phantom's objects:

  • webpage
  • system
  • fs
  • webserver
  • child_process

By looking at the casper object's properties, I did find a reference to the webpage object (casper.page), so my particular use case is handled. I figured I would post this question anyway in case other people need access to system, fs, webserver, or child_process.

Share Improve this question edited Aug 25, 2014 at 15:55 Artjom B. 62k26 gold badges136 silver badges231 bronze badges asked May 21, 2013 at 14:29 mwczmwcz 9,36110 gold badges44 silver badges65 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

I know that with the system and fs modules, you are able to use the same APIs as you would with CasperJS as you would with PhantomJS. This is most likely true for webserver and child_process as well. What I mean by this, is that you can continue to require these modules as you would with PhantomJS, ex:

var fs = require('fs');
var sys = require('system');

As for webpage, you can take a look at my answer here as to how to access the page object that CasperJS uses to run on top of PhantomJS.

Here an example about how you can use the webserver module in CasperJS

CasperJS passing data back to PHP

I'm migrating a script from PhantomJS to CasperJS, and am wondering if Casper provides any references to the Phantom objects that it is using behind the scenes.

Phantom provides some functionality that Casper doesn't (injectJs, for example).

For pleteness' sake, here are all of Phantom's objects:

  • webpage
  • system
  • fs
  • webserver
  • child_process

By looking at the casper object's properties, I did find a reference to the webpage object (casper.page), so my particular use case is handled. I figured I would post this question anyway in case other people need access to system, fs, webserver, or child_process.

I'm migrating a script from PhantomJS to CasperJS, and am wondering if Casper provides any references to the Phantom objects that it is using behind the scenes.

Phantom provides some functionality that Casper doesn't (injectJs, for example).

For pleteness' sake, here are all of Phantom's objects:

  • webpage
  • system
  • fs
  • webserver
  • child_process

By looking at the casper object's properties, I did find a reference to the webpage object (casper.page), so my particular use case is handled. I figured I would post this question anyway in case other people need access to system, fs, webserver, or child_process.

Share Improve this question edited Aug 25, 2014 at 15:55 Artjom B. 62k26 gold badges136 silver badges231 bronze badges asked May 21, 2013 at 14:29 mwczmwcz 9,36110 gold badges44 silver badges65 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

I know that with the system and fs modules, you are able to use the same APIs as you would with CasperJS as you would with PhantomJS. This is most likely true for webserver and child_process as well. What I mean by this, is that you can continue to require these modules as you would with PhantomJS, ex:

var fs = require('fs');
var sys = require('system');

As for webpage, you can take a look at my answer here as to how to access the page object that CasperJS uses to run on top of PhantomJS.

Here an example about how you can use the webserver module in CasperJS

CasperJS passing data back to PHP

本文标签: javascriptDoes CasperJS provide references to the underlying PhantomJS objectsStack Overflow