#coding:utf-8 import urllib.request url=input("url ") up=urllib.request.urlopen(url) s=up.read() h="<img style" c=".jpg" temp="" posh=-len(h) posc=-len(c) i=0 while i<s.count(h): posh=s.find(h,posc+len(h)) posc=s.find(c,posh+len(h)) t=s[posh:posc+len(c)] http=t.find("http") #if len(t[http:])==len(temp): url=t[http:] urllib.request.urlretrieve(url,str(i)+".jpg") i+=1