0

selenium.webdriver.Chrome() Traceback (most recent call last): File "C:\Users\madhu reddy\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\madhu reddy\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\madhu reddy\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "<pyshell#10>", line 1, in selenium.webdriver.Chrome() File "C:\Users\madhu reddy\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\madhu reddy\AppData\Local\Programs\Python\Python38-32\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

1 Answers1

0

In the first error, it says that Python can't find the file, make sure the file exist, or try to use double / instead.


Second, You need to download a driver for Chrome in order to run the JavaScript engine. Once you download it, you need to provide the full path to it or add to your PATH variable in your system.

I can see that you are using Windows, so How to set a new variable in PATH?

driver = webdriver.Chrome() # Will automatically find the webdriver executable
dsasd
  • 222
  • 1
  • 8