# coding: utf-8
import os
from icrawler.builtin import GoogleImageCrawler
"""---------------- Settings ------------------"""
search_word = u"Cat"#In the case of Japanese, in the head"u"Put on
dir_ = "./images/"+search_word+"/"
download_num = 1000 #Number of downloads
"""--------------------------------------------------"""
if not os.path.exists(dir_):#Create if there is no folder
os.makedirs(dir_)
crawler = GoogleImageCrawler(storage={"root_dir": dir_})
crawler.crawl(keyword=search_word, max_num=download_num)
Recommended Posts