Skip to content

Instantly share code, notes, and snippets.

@yushulx
Created November 2, 2020 08:39
Show Gist options
  • Save yushulx/962567eb439bf7b6a27078b0eb1751a6 to your computer and use it in GitHub Desktop.
Save yushulx/962567eb439bf7b6a27078b0eb1751a6 to your computer and use it in GitHub Desktop.
from google_images_download import google_images_download
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("-k", "--keywords", required=True,
help="The keywords/key phrases you want to search for.")
ap.add_argument("-l", "--limit", required=True,
help="The number of images that you want to download.")
args = vars(ap.parse_args())
response = google_images_download.googleimagesdownload()
arguments = {"keywords":args["keywords"],"limit":args["limit"],"print_urls":True}
paths = response.download(arguments)
print(paths)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment