Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looks like we cannot locate the path the 'chromedriver' if limit is included #73

Closed
kevng9 opened this issue Apr 13, 2018 · 31 comments
Closed
Labels

Comments

@kevng9
Copy link

kevng9 commented Apr 13, 2018

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} ] }

@hardikvasa
Copy link
Owner

hardikvasa commented Apr 13, 2018

@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.

@hardikvasa
Copy link
Owner

Closing this issue for now. If you are still experiencing this issue, feel free to reply back here.

@boxabirds
Copy link
Contributor

@hardikvasa I'm having this error happen in this following environment:
Ubuntu 16.04.3 LTS
ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 9515

Command:
googleimagesdownload --config_file gid.json --chromedriver /home//bin/chromedriver
... where that path does work I checked it separately.

@boxabirds
Copy link
Contributor

The precise error is
(fastai) paperspace@ps2ev9u4q:~/data$ googleimagesdownload --config_file gid.json --chromedriver ../bin/chromedriver

Item no.: 1 --> Item name = vespa gtv
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

@hardikvasa hardikvasa reopened this May 12, 2018
@hardikvasa
Copy link
Owner

@boxabirds i am guessing based on your PR #98 , this issue is now resolved for you.

sorry for the late reply. Let me know if you have any other questions.

@boxabirds
Copy link
Contributor

Hi no I'm not having any more luck, the exception doesn't take me any further. Nowhere can I find simple examples of where the chromedriver binary should be and the path that I included isn't working.

@kevinkit
Copy link

  1. Have you tried giving the chromedriver inside python in a dictionary ? Maybe this will work and the error is somewhere in the argument parsing to it
  2. is the path to the executable or to the folder containing the executable? It must be directly to the executable, not only the folder
  3. Why are there two "/" in your path? Maybe this breaks it
  4. Try an absolute path

@hardikvasa
Copy link
Owner

@boxabirds yes it is either the path issue as Kevin suggested or it could be with the google chrome browser itself.

can you follow this guide to fresh install google-chrome-stable?
https://askubuntu.com/questions/510056/how-to-install-google-chrome

do let me know if that works.

@boxabirds
Copy link
Contributor

Chrome's working fine -- I was able to run it directly ok. I'll have a look at it another time. BTW it'd be nice if you had an option to exclude the number prefixes. I've done a local build with a new flag that excludes it as an option

@Mozhdeh-d
Copy link

Mozhdeh-d commented Jun 23, 2018

Hi,
I have the same issue. my chromedriver is installed in /usr/bin and I'm running the following code:
python3 google_images_download.py -k 'cat' -cd /usr/bin -l 140

google_images_download.py file's path is: ~/Documents/google-images-download/google_images_download

And the same error appears when I run the code:
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: 'bin' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home )

Any solution?

@omrysendik
Copy link

Exactly the same issue on my side...
I tried locating the chromedriver in the same folder of setup.py or in the same folder as google_images_download.py (changing the -cd path accordingly of course).
Nothing helped...

@omrysendik
Copy link

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")

@Mozhdeh-d
Copy link

@omrysendik thanks a lot for sharing your knowledge. It worked for me perfectly as well 👍

@gjpicker
Copy link

chromdriver ==2.40 fail ,but re-roll to 2.37 ,all confused resolved ,see more detail in
#120

@NathanYukai
Copy link

I was having the same problem, turns out you have to provide the path to the executable itself, not just the path. For example: /usr/bin/chromedriver , not just /usr/bin/

@Sushmitha-Gowda
Copy link

Sushmitha-Gowda commented Aug 7, 2018

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)

@kranthik13
Copy link

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.

@1ycx
Copy link

1ycx commented Jan 3, 2019

@omrysendik
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")

Thank You ! This works perfectly fine.

@ASH1998
Copy link

ASH1998 commented Mar 27, 2019

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:

@hardikvasa hardikvasa pinned this issue Mar 27, 2019
@jqueguiner
Copy link

could also be you rights on the chromdriver are not the appropriate one (let's chromedriver is root root and you are trying to run the script as ubuntu ubuntu)

@talhaanwarch
Copy link

talhaanwarch commented Sep 9, 2019

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

@zgaxddnhh
Copy link

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

@talhaanwarch
Copy link

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

@zgaxddnhh
Copy link

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

@zgaxddnhh
Copy link

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

@talhaanwarch
Copy link

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

@INF800
Copy link

INF800 commented Sep 19, 2019

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

Thankyou @talhaanwarch It works as charm !

@svyotov
Copy link

svyotov commented Sep 28, 2019

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.

@nicejava
Copy link

Use chormedriver 80 so will solved this problem
https://chromedriver.storage.googleapis.com/index.html?path=80.0.3987.106/

eg. When i extract chormedriver exe to chromedriver_win32-80

chromedriver = "chromedriver_win32-80/chromedriver.exe"
response = google_images_download.googleimagesdownload()
response.download({
    "keywords": "portrait transparent background",
    "color_type": "transparent",
    "size": "medium",
    "limit": 500,
    "output_directory": output_dir,
    "chromedriver": chromedriver})

@ss32
Copy link

ss32 commented Feb 6, 2021

Use chormedriver 80 so will solved this problem
https://chromedriver.storage.googleapis.com/index.html?path=80.0.3987.106/

eg. When i extract chormedriver exe to chromedriver_win32-80

chromedriver = "chromedriver_win32-80/chromedriver.exe"
response = google_images_download.googleimagesdownload()
response.download({
    "keywords": "portrait transparent background",
    "color_type": "transparent",
    "size": "medium",
    "limit": 500,
    "output_directory": output_dir,
    "chromedriver": chromedriver})

Failing, but in a new way for me

$ googleimagesdownload -l=5000 -k "car" --chromedriver  $(pwd)/chromedriver

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: session not created: This version of ChromeDriver only supports Chrome version 80
)

@ss32
Copy link

ss32 commented Feb 6, 2021

Use chormedriver 80 so will solved this problem
https://chromedriver.storage.googleapis.com/index.html?path=80.0.3987.106/
eg. When i extract chormedriver exe to chromedriver_win32-80

chromedriver = "chromedriver_win32-80/chromedriver.exe"
response = google_images_download.googleimagesdownload()
response.download({
    "keywords": "portrait transparent background",
    "color_type": "transparent",
    "size": "medium",
    "limit": 500,
    "output_directory": output_dir,
    "chromedriver": chromedriver})

Failing, but in a new way for me

$ googleimagesdownload -l=5000 -k "car" --chromedriver  $(pwd)/chromedriver

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: session not created: This version of ChromeDriver only supports Chrome version 80
)

Solved by matching the version of chromedriver with my version of Chromium

googleimagesdownload -l 5000 -k "car" -cd $(pwd)/chromedriver

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: session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 87.0.4280.66 with binary path /usr/bin/chromium-browser
)

After downloading the correct version

$ googleimagesdownload -l 5000 -k "car" -cd $(pwd)/chromedriver

Item no.: 1 --> Item name = car
Evaluating...
Getting you a lot of images. This may take a few moments...

SecorD0 pushed a commit to SecorD0/google-images-download that referenced this issue Dec 2, 2022
SecorD0 pushed a commit to SecorD0/google-images-download that referenced this issue Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests