0

I downloaded selenium and chrome driver but when i run

import time
from selenium import webdriver

driver = webdriver.Chrome(executable_path="/Users/NahuApple/webDriver")
driver.get('http://www.google.com/');
time.sleep(5)
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5)
driver.quit()

I get this error

selenium.common.exceptions.WebDriverException: Message: 'webDriver' executable may have wrong permissions?

how can I fix this?

Thanks in advance for the help.

1 Answers1

1

Here you are providing path to a folder, so use the full path to ChromeDriver.exe:

driver = webdriver.Chrome(executable_path=r"C:/Users/NahuApple/webDriver/chromedriver.exe")
Wasif
  • 14,755
  • 3
  • 14
  • 34
  • I tried it and got this error selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH thanks for the help –  Nov 29 '20 at 11:42