GithubHelp home page GithubHelp logo

Comments (31)

omrysendik avatar omrysendik commented on May 14, 2024 52

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

from google-images-download.

svyotov avatar svyotov commented on May 14, 2024 8

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.

from google-images-download.

hardikvasa avatar hardikvasa commented on May 14, 2024 4

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

from google-images-download.

Sushmitha-Gowda avatar Sushmitha-Gowda commented on May 14, 2024 1

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)

from google-images-download.

kranthik13 avatar kranthik13 commented on May 14, 2024 1

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.

from google-images-download.

ASH1998 avatar ASH1998 commented on May 14, 2024 1

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:

from google-images-download.

talhaanwarch avatar talhaanwarch commented on May 14, 2024 1

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

from google-images-download.

talhaanwarch avatar talhaanwarch commented on May 14, 2024 1

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

from google-images-download.

hardikvasa avatar hardikvasa commented on May 14, 2024

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

from google-images-download.

boxabirds avatar boxabirds commented on May 14, 2024

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

from google-images-download.

boxabirds avatar boxabirds commented on May 14, 2024

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

from google-images-download.

hardikvasa avatar hardikvasa commented on May 14, 2024

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

from google-images-download.

boxabirds avatar boxabirds commented on May 14, 2024

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.

from google-images-download.

kevinkit avatar kevinkit commented on May 14, 2024
  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

from google-images-download.

hardikvasa avatar hardikvasa commented on May 14, 2024

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

from google-images-download.

boxabirds avatar boxabirds commented on May 14, 2024

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

from google-images-download.

Mozhdeh-d avatar Mozhdeh-d commented on May 14, 2024

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?

from google-images-download.

omrysendik avatar omrysendik commented on May 14, 2024

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

from google-images-download.

Mozhdeh-d avatar Mozhdeh-d commented on May 14, 2024

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

from google-images-download.

gjpicker avatar gjpicker commented on May 14, 2024

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

from google-images-download.

NathanYukai avatar NathanYukai commented on May 14, 2024

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/

from google-images-download.

yaamas avatar yaamas commented on May 14, 2024

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

from google-images-download.

jqueguiner avatar jqueguiner commented on May 14, 2024

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)

from google-images-download.

zgaxddnhh avatar zgaxddnhh commented on May 14, 2024

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

from google-images-download.

talhaanwarch avatar talhaanwarch commented on May 14, 2024

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

from google-images-download.

zgaxddnhh avatar zgaxddnhh commented on May 14, 2024

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

from google-images-download.

zgaxddnhh avatar zgaxddnhh commented on May 14, 2024

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

from google-images-download.

INF800 avatar INF800 commented on May 14, 2024

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 !

from google-images-download.

nicejava avatar nicejava commented on May 14, 2024

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

from google-images-download.

ss32 avatar ss32 commented on May 14, 2024

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
)

from google-images-download.

ss32 avatar ss32 commented on May 14, 2024

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

from google-images-download.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.