def save_images(page):
local_images = []
counter = 0
for i,img in enumerate(page.images):
fname = img.split("/")[-1];
if img.endswith(IMAGES_EXT) and "Aquote" not in fname and "Commons-logo" not in fname and "Wiktionary" not in fname:
print fname
urllib.urlretrieve(img, "./files/"+fname)
local_images.append("./files/"+fname)
counter += 1
if counter >= IMAGES_COUNT:
break
return local_images
评论列表
文章目录