How to download using wget one by one in a loop in python
<p>I have following code written which downloads from a page:</p>

<pre><code>import urllib2,os
    from bs4 import BeautifulSoup

    page = urllib2.urlopen('http://somesite.com')
    soup = BeautifulSoup(page)

    for a in soup.find_all('a', href=True):
        if "tutorials" in a['href']:
            os.system('wget ' + a['href'])
</code></pre>

<p>The issue is above command is it downloads all links altogether from the page. I want to download videos one by one. Is that possible? Please help me.</p>

<p>Use the subprocess.call module instead of os.system.</p>

<pre><code>subprocess.call(['wget' , a['href']])
</code></pre>

python loops wget