1

My code

from selenium import webdriver
dr = webdriver.Chrome()
dr.close()

I got this error

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
  • Possible duplicate of [Error message: "'chromedriver' executable needs to be available in the path"](https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path) – demouser123 Jul 03 '18 at 07:07

2 Answers2

0

The error is telling you what is wrong: the chromedriver program is not found in your executable path (stored in the environment as $PATH).

You can tell what the current path is using something like this:

import os
print os.environ['PATH']

Once you know the path, you can install chromedriver into one of the directories in the path.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
0

The correct solution would be to just add the path of your chrome driver. The best way to do that is just have the chrome driver in the same directory as you are probably going to be updating it a lot since google is still working on it.

divyanshch
  • 390
  • 5
  • 15