google-images-download: Looks like we cannot locate the path the 'chromedriver' if limit is included

OS: osx 10.12.6 Python version: 3.6.5 Issue steps: When running CLI with -l or --limit option specified, the following error is returned. Looks like we cannot locate the path the 'chromedriver' (use the '--chromedriver' argument to specify the path to the executable.) or google chrome browser is not installed on your machine executing without -l works fine.

Attempted to use json input but still returning same error. json file contents below: { "Records": [ {"keywords": "tops","limit": 1000}, {"keywords": "jacket","limit": 1000} ] }

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 31 (8 by maintainers)

Commits related to this issue

Most upvoted comments

OK, I was able to make it work like this:

  1. Installed the chromium-chromedriver: sudo apt-get install chromium-chromedriver
  2. Adding the path to the selenium line. Line 167 in ./google_images_download/google_images_download.py to: browser = webdriver.Chrome(“/usr/lib/chromium-browser/chromedriver”)

I had this issue too, the issue is that all command line arguments are ignored when the config file argument is present. googleimagesdownload -cf cfg.json --chromedriver '/usr/bin/chromedriver' will ignore the --chromedriver argument. You can add it to the configuration file { "Records": [ {"keywords": "tops","limit": 1000, "chromedriver": "/usr/bin/chromedriver"}, {"keywords": "jacket","limit": 1000, "chromedriver": "/usr/bin/chromedriver"} ] }, a bit too verbose, but it works.

@kevng9 the limit is set to 100 if you do not specify the -l flag. If you want to download more than 100 images, you will have to specify the -cd flag and give the path to chromedriver that is installed in your machine. More details can be found in the documentation of this project.

Do let me know if that works for you.

sorry,

Here is the solution that work for me. Step 1 Download chrome browser where you want it (https://chromedriver.chromium.org/downloads) Step 2 from google_images_download import google_images_download press ctrl and click google_images_download and open google_images_download.py file go to line 177 where it is written as browser = webdriver.Chrome(chromedriver, chrome_options=options) change it to browser = webdriver.Chrome("D:/chromedriver_win32/chromedriver", chrome_options=options) Here chromedriver is not the name of folder, but its the exe file Note: This (D:/chromedriver_win32/) should be your path to chrome file

I use the same method as you, but I still get wrong. File “google_images_download.py”, line 179 browser = webdriver.Chrome(‪’D:/chromedriver_win32/chromedriver’, chrome_options=options) ^ TabError: inconsistent use of tabs and spaces in indentation

actually you have made indentation error. can you post the screen shot

image

image

apparently it seems you have some issue with indentations, can you undo all changes, you have made. you can try pip uninstall google_images_download and then install again. make sure, instead of changing the complete browser = webdriver.Chrome(chromedriver, chrome_options=options) just change chromedriver. this will help to avoid indentation issue

Here is the solution that work for me. Step 1 Download chrome browser where you want it (https://chromedriver.chromium.org/downloads)

Step 2 from google_images_download import google_images_download press ctrl and click google_images_download and open google_images_download.py file go to line 177 where it is written as browser = webdriver.Chrome(chromedriver, chrome_options=options)

change it to browser = webdriver.Chrome("D:/chromedriver_win32/chromedriver", chrome_options=options)

Here chromedriver is not the name of folder, but its the exe file

Note: This (D:/chromedriver_win32/) should be your path to chrome file

While using arguments, you can specify the path…kinda like this

First response = google_images_download.googleimagesdownload() Then, arguments = {"keywords": query, "format": "jpg", "limit":200, "print_urls":True, "size": "medium", "aspect_ratio": "panoramic", "output_directory": r"Foldername/to store", "chromedriver": r"Path to \chromedriver_win32\chromedriver.exe"}

Then, response.download(arguments)

Keep it inside try: and catch:

I had my chromedriver in this location - “/usr/lib/chromium-browser/chromedriver” So just append your previous command with --chromedriver /usr/lib/chromium-browser/chromedriver

Hope it helps.

same error googleimagesdownload -k “car” -l 150 --chromedriver C:\Users\rsushmitha\Downloads\chromedriver_win323

Item no.: 1 --> Item name = car Evaluating… Looks like we cannot locate the path the ‘chromedriver’ (use the ‘–chromedriver’ argument to specify the path to the executable.) or google chrome browser is not installed on your machine (exception: Message: ‘chromedriver_win323’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home)