Gettin an error chromedriver.exe' executable needs to be in PATH

Viewed 79

I have resolved this issue but still want to post as a QA.

#My code 
# import web driver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

# specifies the path to the chromedriver.exe
s = Service('/chromedriver.exe')

driver = webdriver.Chrome(service=s)

# driver.get method() will navigate to a page given by the URL address
driver.get('https://www.google.com')

error : WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

1 Answers
  1. Check where is your Path?
import sys
print(sys.path)

Add the file in your path and run the code.

Related