Python 3 icrawler Library Script to Crawl and Download Multiple Images From Google Search Engine Keywords Full Project For Beginners



Welcome folks today in this blog post we will be crawling and scraping and downloading images using the icrawler library in python. All the full source code of the application is shown below.




Get Started




In order to get started you need to install the below library using the pip command as shown below



pip install icrawler



After installing this library you need to make an file and copy paste the following code




Using built-in crawlers is very simple. A minimal example is shown as follows.


from icrawler.builtin import GoogleImageCrawler

google_crawler = GoogleImageCrawler(storage={'root_dir': 'your_image_dir'})
google_crawler.crawl(keyword='cat', max_num=100)


You can also configurate number of threads and apply advanced search options. (Note: compatible with 0.6.0 and later versions)


from icrawler.builtin import GoogleImageCrawler

google_crawler = GoogleImageCrawler(
    storage={'root_dir': 'your_image_dir'})
filters = dict(
    date=((2017, 1, 1), (2017, 11, 30)))
google_crawler.crawl(keyword='cat', filters=filters, max_num=1000, file_idx_offset=0)

Leave a Reply