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
- doc changes required as per #110, #120, #130, #132, #73 — committed to hardikvasa/google-images-download by deleted user 6 years ago
- doc changes required as per #110, #120, #130, #132, #73 — committed to hardikvasa/google-images-download by deleted user 6 years ago
- doc changes required as per #110, #120, #130, #132, #73 — committed to SecorD0/google-images-download by deleted user 6 years ago
- doc changes required as per #110, #120, #130, #132, #73 — committed to SecorD0/google-images-download by deleted user 6 years ago
OK, I was able to make it work like this:
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--chromedriverargument. 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
-lflag. If you want to download more than 100 images, you will have to specify the-cdflag 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.
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 changechromedriver. this will help to avoid indentation issueHere 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_downloadpress ctrl and click google_images_download and open google_images_download.py file go to line 177 where it is written asbrowser = 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:andcatch: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)