Download specific file in url using PHP/Python
<p>I previously used to use <code>wget -r</code> on the linux terminal for downloading files with certain extensions:</p>

<pre><code>wget -r -A Ext URL
</code></pre>

<p>But now I was assigned by my lecturer to do the same thing using PHP or Python.  Who can help?</p>

<p>You can use PHP function <code>file_get_contents()</code> to retrieve the contents of a documents. The first argument of the function is filename which can either be a local path to a file or a URL.<br>
See example from PHP <a href="http://php.net/manual/en/function.file-get-contents.php" rel="nofollow">docs</a>    </p>

<pre><code>&lt;?php
    $homepage = file_get_contents('http://www.example.com/');
    echo $homepage;
?&gt;
</code></pre>

php python web-crawler wget