wiki.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:tulen 作者: detorto 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号