how do i use it in nodejs.

190 views
Skip to first unread message

范永东

unread,
Jun 27, 2013, 12:10:03 AM6/27/13
to phan...@googlegroups.com
   npm install node-phantom or phantom-node  ,,,,,,but it doesnot work....


    i want use it in web environment,so i want use it in nodejs  ,,,can connect with DB.

Bryan Bishop

unread,
Jun 27, 2013, 12:21:51 AM6/27/13
to phan...@googlegroups.com, Bryan Bishop
On Wed, Jun 26, 2013 at 11:10 PM, 范永东 <dabe...@gmail.com> wrote:
   npm install node-phantom or phantom-node  ,,,,,,but it doesnot work....

You don't install phantomjs with npm. (There's no official phantomjs npm package.) You run phantomjs separately, and then communicate with it through inter-process communication with dnode, HTTP, or some other technique.

- Bryan
http://heybryan.org/
1 512 203 0507

Rock Li

unread,
Jun 27, 2013, 12:26:17 AM6/27/13
to phan...@googlegroups.com, Bryan Bishop

In your web codes, use NodeJS to fork a new process and communicate it,  like by using the api `popen` or something others. 


--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

范永东

unread,
Jun 27, 2013, 2:53:57 AM6/27/13
to phan...@googlegroups.com
here is my code:
              var childProcess = require('child_process');

              var path=[];

              var childArgs = ['user.js']  ;

              console.log("user:",childArgs);

              var bp="ls";

             childProcess.execFile("phantomjs",childArgs,function(err, stdout, stderr) {


     console.log("hello");
     console.log("err:",err);
     console.log("stdout:",stdout);
     console.log("stderr:",stderr);
     

                });
           

   console:
user: [ 'user.js' ]
hello
err: { [Error: Command failed: execvp(): Too many levels of symbolic links
] killed: false, code: 127, signal: null }
stdout: 
stderr: execvp(): Too many levels of symbolic links

      so   still    is wrong.......i 

                



在 2013年6月27日星期四UTC+8下午12时10分03秒,范永东写道:

James Greene

unread,
Jun 27, 2013, 9:43:00 AM6/27/13
to phan...@googlegroups.com

Please inquire with the Node.js community, this has nothing to do with PhantomJS.

Sincerely,
   James Greene

--

Nissan Pow

unread,
Jun 29, 2013, 12:23:16 AM6/29/13
to phan...@googlegroups.com
node-phantom is working fine for me. You should post more details other than "doesn't work" (either on the nodejs mailing list, or reach out to the maintainer of the npm package).
Note that node-phantom doesn't come with phantomjs.. you still have to install that separately. 


2013/6/27 范永东 <dabe...@gmail.com>
   npm install node-phantom or phantom-node  ,,,,,,but it doesnot work....


    i want use it in web environment,so i want use it in nodejs  ,,,can connect with DB.

--
Reply all
Reply to author
Forward
0 new messages