
たこxyz
python icrawler で画像ダウンロードしたいのにできてない
そんな問題事象に対処法を紹介します。
対処
GoogleImageCrawler だと失敗してしまいます。
BingImageCrawler に変更しましょう。
そちらを使用すると、ダウンロードができます。
以下がコードになります。
※imagesディレクトリに画像が保存されます。
from icrawler.builtin import BingImageCrawler bing_crawler = BingImageCrawler(storage={'root_dir': 'images'}) bing_crawler.crawl(keyword='猫', max_num=100)
紹介は以上になります。
閲覧ありがとうございました。