簡體   English   中英

Python Google 圖片下載不起作用

[英]Python Google Images download does not work

我正在通過 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')

似乎谷歌最近從頁面中刪除了rg_metadata ,這是google_images_download用來處理來自 raw_html 的圖像的。 這樣它就壞了。

嘗試從 Ubuntu 終端運行 py 文件。 它工作正常。 我認為它不適用於 Windows 操作系統。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM