0

I need to save my .php file as an .html for backup with using PHP whenever page called (I am going to use ob_start() for it). But the page content is not static. I am using AJAX to load the content.

That's why view-source: does not show the dynamic data, only chrome inspector show them. But I need to save the page with all elements after page loads. Is it possible or not?

BTW after page loads, there is no any other ajax call (on click or something). Page loads all content on init.

Thanks in advance.

  • As I understand you need to emulate a browser – Emeeus May 21 '18 at 13:59
  • 1
    I was going to suggest Selenium with the PHP WebDriver binding. My guess is the OP will say it cannot be a testing framework - must be from operational server - so it cannot be done. – Randy Casburn May 21 '18 at 14:03
  • @RandyCasburn yep, you are right mate. In 2018, we still can't find a solution to this problem, even we use the latest technologies :) – gimmeonereason May 21 '18 at 14:08
  • Other solution would be getting json data in php with using `file_get_contents` instead of `$.ajax`. What do you think @RandyCasburn? – gimmeonereason May 21 '18 at 14:42
  • square peg - round hole; I don't understand the absolute requirement to use a server side language that is not available in the browser (PHP) to perform a task that can only be completed in the browser. So square peg - stated differently, you have the XY Problem: https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – Randy Casburn May 21 '18 at 16:54

0 Answers0