7

I'm crawling an image through Google Image downloader. The code that originally worked started to suddenly stop working How do we solve this problem? Code and error messages are as follows

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')

Twenty
  • 5,234
  • 4
  • 32
  • 67
변구훈
  • 111
  • 1
  • 4
  • There are several other ways to dowload google images in python, given here: https://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search – Ramsha Siddiqui Feb 09 '20 at 16:18
  • 1
    Thanks so much for the answer. I tried to proceed with the information I posted, but it's not working. I'm not crawling because of image copyright on Google or I don't know if that's the problem – 변구훈 Feb 11 '20 at 11:16
  • @변구훈 did you find any solution? I was drawling the urls for images using that API (not downloading) then suddenly it stopped working as well :( – Skynet094 Feb 23 '20 at 05:01
  • @Skynet094 The confirmation is late. I eventually decided to crawl a non-Google website image – 변구훈 Feb 28 '20 at 16:42
  • Would you please share the code do to it if it's okay? Thanks! It's fine if it is not – Skynet094 Feb 29 '20 at 07:19

2 Answers2

1

It seems google recently removed the rg_metadata from the page, which is what google_images_download was using to process the images from the raw_html. As such it's broken.

ameet chaubal
  • 1,440
  • 16
  • 37
0

Try to run the py file from the Ubuntu terminal. It works fine. I think it's not working in Windows OS.

Praveen Kumar
  • 849
  • 8
  • 8