Executing CasperJS from a PHP script (ideally Codeigniter)
658 views
Skip to first unread message
Gavin
unread,
Aug 1, 2013, 9:45:30 AM8/1/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to casp...@googlegroups.com
Hi guys,
I have setup the latest version of CasperJS & PhantomJS (all works well so far) - I want to be able to execute a javascript script with the Casper code in directly from my PHP script - also how is the best way to handle passing data to and from the script.
I am using this with Codeigniter - would there be an library that would be suitable for this?
Robert Igl
unread,
Aug 1, 2013, 10:04:45 AM8/1/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to casp...@googlegroups.com
You can use exec for this To pass data just append them after the exec and access it in phantomjs/casperjs via var yourVar = require('system').args[1]; You can pass as much as you want, [1] will just give the first argument passed after the script which should be executed
Gavin
unread,
Aug 1, 2013, 12:00:14 PM8/1/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to casp...@googlegroups.com
Brilliant Robert - you've been super useful today! :-)
lavesh bhandari
unread,
Aug 20, 2013, 4:50:57 AM8/20/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to casp...@googlegroups.com
Hi Robert,
I am also looking to run casperJS script via php. Since I am a very noob in this stuff can you please explain your answer in a bit detail.