use googleimagedownload python library.

pypi link

here’s an example to run by importing

from google_images_download import google_images_download

response = google_images_download.googleimagesdownload()

response.download({
    "keywords": "flower, car",
    "format": "png"
    })

if you want a lot of keywords, try this code

from google_images_download import google_images_download

response = google_images_download.googleimagesdownload()


keyword_list=[
    "flower",
    "car",
    "seoul",
    "nature",
    "forest",
    "city",
    "machine",
    "graphic art",
    "computer",
    "people",
    "microscopic images",
    "colorful",
    "tiny stuff",
    "dense",
    "xray",
    "population",
    "crowded",
    "person",
    "scene",
    "coat",
    "rain",
    "cartoon",
    "dark nature",
    "sky",
    "night vision",
    "semiconductor",
    "grid",
    "pixel art"
]

keyword_str=""
for index, k in enumerate(keyword_list):
    if index == len(keyword_list)-1:
        keyword_str+=k
    else:
        keyword_str+=k
        keyword_str+=','
    

response.download({
    "keywords":keyword_str,
    "format": "png"
    })
Categories: python

0 Comments

Leave a Reply

Your email address will not be published.