4

I want to crawl some images for my machine learning practice and found this google-image-download to very useful and the codes works out of the box.

However, at the moment, it only allow not more than 100 images, which is the limit from google image page(that only load 100 images per page).

The document said if you are using pip install google_images_download(which in my case, I am doing that), it will download together with selenium and by using chromedriver, you can download more than that limit.

however, everytime I run the code python gimages.py:

from google_images_download import google_images_download  

response = google_images_download.googleimagesdownload() 

arguments = {"keywords":"number plates","limit":200,"print_urls":True}  
paths = response.download(arguments)
print(paths) 

I will get error:

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: expected str, bytes or os.PathLike object, not NoneType)

as I checked my installation, selenium already installed: enter image description here

  1. reading further, it said I can download chromedriver and put inside the same folder and call python gimages.py --chromedriver "chromedriver", I still get the same error.

How can I resolve this?

I am using conda with python 3.6, running the terminal from conda. the code is already working, just that chromedriver part is not.

sooon
  • 4,718
  • 8
  • 63
  • 116

1 Answers1

0

You need to specify the path... "chromedriver" is not a path...

You might need to the explicit path "/path/to/chromedriver/folder".

In your case: python gimages.py --chromedriver "/path/to/chromedriver/folder"

Hope this helps you!

Moshe Slavin
  • 5,127
  • 5
  • 23
  • 38
  • Sorry but I am using mac, and the `chromedriver` is `unix executable`. do I need to add extension? – sooon Jan 03 '19 at 01:55
  • Not working. I tried `"/path/to/folder"` and `"path/to/folder/"`. Both not working. – sooon Jan 03 '19 at 11:20
  • @sooon the example: `"/path/to/folder"` is just an example... you need to specify the path to the `chromedriver`... – Moshe Slavin Jan 16 '19 at 15:44