I want to copy the entire source code of an external website to a file for later modification and analysis. But a table on domain.com/stats is not static HTML but is build by JavaScript and loaded on page load.
The problem is that it thus is not included in the source code!
This is what my code look like right now:
$txt = file_get_contents('http://domain.com/stats');
file_put_contents(dirname(__FILE__) . '/statistic/stats.html', $txt);
Is there a work around for this?
if you scan
$txtfor dynamically loaded content, you could perform furtherfile_get_contentsrequests to retrieve those contents as well and store those along with the original content.