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>Alternatively, you can use <a href="http://docs.python-requests.org/en/master/" rel="nofollow">Requests</a>: Requests is the only Non-GMO HTTP library for Python, safe for human consumption.</p>

<p>Example (from the doc):</p>

<pre><code>&gt;&gt;&gt; r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
&gt;&gt;&gt; r.status_code
200
&gt;&gt;&gt; r.headers['content-type']
'application/json; charset=utf8'
&gt;&gt;&gt; r.encoding
'utf-8'
&gt;&gt;&gt; r.text
u'{"type":"User"...'
&gt;&gt;&gt; r.json()
{u'private_gists': 419, u'total_private_repos': 77, ...}
</code></pre>

php python web-crawler wget