Casperjs on my website code

36 views
Skip to first unread message

tawf...@digdynamics.com

unread,
Dec 4, 2016, 12:25:12 AM12/4/16
to CasperJS
Hello Dear,
I need to use casperjs module to call link on my code not on separate js file runs from command, I need in my web site javascript code when button click e.g
how to do this?

thank you.

Ken

unread,
May 25, 2017, 10:29:13 AM5/25/17
to CasperJS
I've just made a reply to similar question. For example, in the case of PHP it can be something like below. For other web app it really depends how they call shell commands. CasperJS underlying browser is base on PhantomJS, so it can only be initiated from command, not directly executable in user's browsers as JavaScript.

"I've done something similar. You basically get data then feed to CasperJS run. Some ways to do that is using exec PHP command directly, or you can set up some other PHP webservice which eventually still have to execute the command.

Output can be returned directly to calling PHP script or maybe write and read from file. However, there will be significant lag time while the whole process runs and results gets returned back. Normally is too long for good user experience, unless you design some other animation or status message to say nicely that you are collecting data in progress.

To invoke CasperJS + PhantomJS and depending on the number of automation steps, may take very long to return results."
Reply all
Reply to author
Forward
0 new messages