Python Google 图片下载不起作用

변구훈*_*변구훈 7 python web-crawler

我正在通过 Google 图片下载器抓取图片。原本可以运行的代码突然停止运行了,这个问题怎么解决?代码和错误信息如下

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')
Run Code Online (Sandbox Code Playgroud)

use*_*330 1

谷歌最近似乎rg_metadata从页面中删除了 ,这是google_images_download用来处理 raw_html 中的图像的。因此它就坏了。