-1

I have properly install selenium and chromedriver and wanted to execute this below code at python

import selenium
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r"C:\Users\SM.Nibir\Desktop\Python\chromedriver_win32\chromedriver.exe")

but I am getting these errors on my output panel

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "c:/Users/SM. Nibir/Desktop/Python/import os.py", line 3, in <module>
    driver = webdriver.Chrome()
  File "C:\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\python\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Who can I solve this problem and make this code work properly?

SM.NIBIR
  • 1
  • 2
  • Have you even read the error message?: `Message: 'chromedriver' executable needs to be in PATH.` – Ruli Oct 15 '20 at 15:23
  • See https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path –  Oct 15 '20 at 15:23
  • 1
    Does this answer your question? [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) –  Oct 15 '20 at 15:24
  • from selenium import webdriver driver = webdriver.Chrome(executable_path=r"F:/Web Development/chromedriver_win32/chromedriver.exe") this is not working also – SM.NIBIR Oct 16 '20 at 06:42

1 Answers1

0

first of all, your first mistake is that you wrote "import selenium from.." so the order has to be that way:

from selenium import webdriver
driver=webdriver.Chrome(executable_path=r"C:\Users\...chromedriver.exe")

ofcourse that you need to change the path for the correct location of your chromedriver.exe file.

let me know if it helps.

evyatar weiss
  • 140
  • 1
  • 5
  • I also tried this: from selenium import webdriver driver = webdriver.Chrome(executable_path=r"C:\Users\SM. Nibir\Desktop\Python\chromedriver_win32\chromedriver.exe") but getting File "c:/Users/SM. Nibir/Desktop/Python/practices.py", line 3, in driver = webdriver.Chrome(executable_path=r"C:\Users\SM. Nibir\Desktop\Python\chromedriver_win32\chromedriver.exe") File "C:\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__ RemoteWebDriver.__init__( – SM.NIBIR Oct 16 '20 at 06:34
  • can you edit your question with the current error?, the full one. i will solve it dont worry – evyatar weiss Oct 16 '20 at 15:39