google-images-download icon indicating copy to clipboard operation
google-images-download copied to clipboard

Only able to downloads 100 images and failing if its more than 100 images

Open vasanthhr opened this issue 3 years ago • 1 comments

Trying to download bunch of images using chromium driver and google-images-dowalod, but it works if i give limit as 100, and it fail if i give limit as more than 100.

code to run :

os.system('googleimagesdownload --keywords ' + args.keyword + ' --limit ' + args.limit + 
          ' --output_directory ' + output_dir + ' --image_directory ' + image_dir + ' --color_type ' + ct
          + ' --chromedriver ./chromedriver --size medium')

error(if i give more than 100 images as limit):


/home/ubuntu/Desktop/bg_remove/dataset

Item no.: 1 --> Item name = colorful-background
Evaluating...
Traceback (most recent call last):
 File "/home/ubuntu/anaconda3/envs/u2net_v1/bin/googleimagesdownload", line 33, in <module>
   sys.exit(load_entry_point('google-images-download==2.8.0', 'console_scripts', 'googleimagesdownload')())
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/google_images_download-2.8.0-py3.6.egg/google_images_download/google_images_download.py", line 1134, in main
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/google_images_download-2.8.0-py3.6.egg/google_images_download/google_images_download.py", line 952, in download
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/google_images_download-2.8.0-py3.6.egg/google_images_download/google_images_download.py", line 1079, in download_executor
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/google_images_download-2.8.0-py3.6.egg/google_images_download/google_images_download.py", line 242, in download_extended_page
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/selenium-4.0.0b2-py3.6.egg/selenium/webdriver/__init__.py", line 18, in <module>
   from .firefox.webdriver import WebDriver as Firefox  # noqa
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/selenium-4.0.0b2-py3.6.egg/selenium/webdriver/firefox/webdriver.py", line 25, in <module>
   from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/selenium-4.0.0b2-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 36, in <module>
   from .log import Log
 File "/home/ubuntu/anaconda3/envs/u2net_v1/lib/python3.6/site-packages/selenium-4.0.0b2-py3.6.egg/selenium/webdriver/remote/log.py", line 22, in <module>
   from contextlib import asynccontextmanager
ImportError: cannot import name 'asynccontextmanager'

vasanthhr avatar Mar 17 '21 08:03 vasanthhr

I had the same issue, I solved it by using a newer python version (python 3.9 worked for me)

smandelli avatar Jun 13 '22 11:06 smandelli