How to automatically and periodically save from this page to my web server with PHP?
You can make a web page scraper script in PHP, then schedule it to run using cron jobs.
<?php
// Call this file 'scraper.php'
$local_file = "local.html"; // local destination
$remote_file = "http://example.com/page.html"; // source
$ch = curl_init();
$fp = fopen ($local_file, 'w+');
$ch = curl_init($remote_file);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_exec($ch);
curl_close($ch);
fclose($fp);?>
You can make a web page scraper script in PHP, then schedule it to run using cron jobs.
To automatically run this script every day, make a cron job something like this
* 0 * * * /usr/bin/php /root/document/path/scraper.php
*where scraper.php is the name of the code block above, /usr/bin/php is the server path to the PHP interpreter, and * 0 * * * are timing parameters that make the script run once per day. *
If you want to save the webpage to your server as a local file you could do it like this:
$html = file_get_contents("http://example.com/page.html");file_put_contents("/path/to/local.html", $html);
below code not working pleas fix it
if (!file_exists('/local_mis.php')) {
mkdir('/causelist/madras/causelist/misc/', 0777, true);}