getting imgae src and save images in a directory by python image crawler
<p>I want to create a python image crawler.</p>

<p>This is what I have now:</p>

<pre><code>from bs4 import BeautifulSoup
from urllib.request import urlopen
url = 'http://blog.pouyacode.net/'
data = urlopen(url)
soup = BeautifulSoup(data, 'html.parser')
img = soup.findAll('img')
print (img)
print ('\n')
print ('****************************')
print ('\n')
for each in img:
    print(img.get('src'))
    print ('\n')
</code></pre>

<p>This part works:</p>

<pre><code>print (img)
print ('\n')
print ('****************************')
print ('\n')
</code></pre>

<p>But after <code>*****************</code> in the output, this errors appears:</p>

<pre><code>Traceback (most recent call last):
File "pull.py", line 15, in &lt;module&gt;
print(img.get('src'))
AttributeError: 'ResultSet' object has no attribute 'get'
</code></pre>

<p>So how can I get all the SRC of all images?
And how can I save those images in a directory? </p>