简体   繁体   中英

Pause and Resume CasperJS, PhantomJS Script

I am using in PHP the library PhantomJS with CasperJS for automatize a web workflow.

How Can I "Pause" the script, saving all the resource, do something with the content and after resume it?

Example: 1 - load a website. 2 - get info of the page, exit the script and do your stuff in php for example. 3 - go back to the same page without reloading it , and continue javascript and navigation.

Right now I have to reask for the last page, and that is the problem.

You cannot pause execution, but you can certainly call your PHP script from CasperJS/PhantomJS through the Child Process Module . Save the content in some temporary file using the File System Module and pass the temporary filename to the PHP script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM