current position:Home>Report the wrong information, have a look!, What went wrong with this?

Report the wrong information, have a look!, What went wrong with this?

2022-01-27 01:11:26 CSDN Q & A

Traceback (most recent call last):  File "C:\Users\Zycc\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start    self.process = subprocess.Popen(cmd, env=self.env,  File "C:\Users\Zycc\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__    self._execute_child(args, executable, preexec_fn, close_fds,  File "C:\Users\Zycc\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,FileNotFoundError: [WinError 2]  The system cannot find the specified file .During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "E:/ Stocks / test .py", line 28, in <module>    bro = webdriver.Chrome(executable_path=r'C:\Users\ASUS\Desktop\ data mining \chromedriver.exe')  File "C:\Users\Zycc\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__    self.service.start()  File "C:\Users\Zycc\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start    raise WebDriverException(selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home



Refer to the answer 1:

take chromedriver.exe Put directly python Of Scripts Under the table of contents , Write directly to browser objects under construction webdriver.Chrome(), You can avoid the error that the path file cannot be found .




Refer to the answer 2:



Refer to the answer 3:

Try changing the Chinese of the path into English , Try not to use Chinese in the code




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270111244926.html

Random recommended