As title, my question is how to output (lets say save as a text file on server computer or pass the result to some other php function using ajax) all DOM content on a page?
I did some homework, I tried curl can just output all DOM content using "curl http://google.ca > dom.txt" However, the this approach will not save contents that Javascript generated, in other words, the javascript code will not run. Another approach is to embed some javascript code into a page and let the page load the website we want to output, then use the javascript code to save all DOM file after everything is loaded.
I am not sure if phantom.js can do such job, if yes, then how to?
Any body can give a detailed answer on how to achieve this?
I am open to any solutions, this program will run on my server to provide service.
Thank you in advance.