I have a list of urls of some images and I want to download them import urllib
links = ['http://www.takamine.com/templates/default/images/gclassical.png',
'https://dk1xgl0d43mu1.cloudfront.net/user_files/esp/product_images/000/010/120/large.png?1389980652',
'https://dk1xgl0d43mu1.cloudfront.net/user_files/esp/product_images/000/020/676/large.png?1453396324']
#urllib.urlretrieve('http://www.takamine.com/templates/default/images/gclassical.png','image.jpg')
for i in range(0,4):
S1 = 'image'
S2 = '.png'
name = list()
x = S1 + str(i) + S2
name.append(x)
for q in links:
urllib.urlretrieve(q,name)
I understand how to retrieve one at a time....when I try this code i get this error
Traceback (most recent call last): File "C:/Python27/metal memes/test1.py", line 17, in urllib.urlretrieve(q,name) File "C:\Python27\lib\urllib.py", line 98, in urlretrieve return opener.retrieve(url, filename, reporthook, data) File "C:\Python27\lib\urllib.py", line 249, in retrieve tfp = open(filename, 'wb') TypeError: coercing to Unicode: need string or buffer, list found
any answers , explanations are appreciated