C:\Users\abhi1702\Desktop\selemen\venv\Scripts\python.exe
C:/Users/abhi1702/Desktop/selenium/app.py
Traceback (most recent call last):
File "C:Usersabhi1702Desktopseleniumvenvlibsite-packagesseleniumwebdrivercommonservice.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:Usersabhi1702AppDataLocalProgramsPythonPython38-32libsubprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:Usersabhi1702AppDataLocalProgramsPythonPython38-32libsubprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
在处理上述异常的过程中,发生了另一个异常:
Traceback (most recent call last):
File "C:/Users/abhi1702/Desktop/selenium/app.py", line 5, in <module>
chrome= webdriver.Chrome(executable_path='Usersabhi1702Desktopchromedriverchromedriver.exe')
File "C:Usersabhi1702Desktopseleniumvenvlibsite-packagesseleniumwebdriverchromewebdriver.py", line 73, in __init__
self.service.start()
File "C:Usersabhi1702Desktopseleniumvenvlibsite-packagesseleniumwebdrivercommonservice.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
答案可能在你的帖子中:
Message: 'chromedriver.exe' executable needs to be in PATH
因此,请尝试将chromedriver.exe添加到系统变量PATH中。
对于Windows,打开"系统属性"-"环境变量"-并修改系统变量"PATH":单击"编辑",添加带有chromedriver.exe路径的新条目,例如:C:\drivers\chromedriver.exe