Python谷歌图片下载不成功

问题描述 投票:5回答:1

我在通过谷歌图片下载器抓取一张图片.原本工作的代码开始突然停止工作如何解决这个问题?代码和错误信息如下

from google_images_download import google_images_download   

def ImageCrawling(keyword, dir):
    response = google_images_download.googleimagesdownload()  

    arguments = {"keywords":keyword 
        ,"limit":2 
        ,"print_urls":True 
        ,'output_directory':dir}   
    paths = response.download(arguments)   #passing the arguments to the function
    print(paths)   #printing absolute paths of the downloaded images

ImageCrawling('dog','C:\\nuguya')

python web-crawler
1个回答
0
投票

最近google好像删除了 rg_metadata 从页面,这就是 google_images_download 是用来处理raw_html中的图片的.因此它被破坏了。

© www.soinside.com 2019 - 2024. All rights reserved.