Using casperjs to scrap a website content and output it to php

31 views
Skip to first unread message

Mbaegbu Emeka

unread,
Dec 19, 2016, 5:48:14 AM12/19/16
to CasperJS
Hello guys,
Here is what I want to achieve with Casperjs and PHP:
1) My website ask user to search for item
2) My website grabs that item from other websites such as google. Items like, links, images, and contents from google.
3) And then my website displays the output of the items back to the users.

Please will be happy to get ideas on how to go about this.
regards: Emeka

Ken

unread,
May 25, 2017, 10:25:22 AM5/25/17
to CasperJS
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