import requests
from BeautifulSoup import BeautifulSoup
r = requests.get('http://<url>')
while r.status_code!=200:
r = requests.get('http://<urL>')
soup = BeautifulSoup(r.text)
images = soup.findAll('img')
for i in range(0, len(images)):
url= 'http://<url>'+images[i]['src']
img = requests.get(url)
while img.status_code!=200:
img = requests.get(url)
with open(str(i)+".jpg", 'wb') as test:
test.write(img.content)