错误"Service.py"



我是Python和Pycharm的新手,在理解这个消息时遇到了一些问题:

Traceback (most recent call last):
File "C:UsersreydePycharmProjectsLiderwsvenvlibsite-packagesseleniumwebdrivercommonservice.py", line 76, in start
stdin=PIPE)
File "C:Program Files (x86)Python36-32libsubprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:Program Files (x86)Python36-32libsubprocess.py", line 997, in _execute_child
startupinfo)
PermissionError: [WinError 5] Acceso denegado

在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last):
File "C:/Users/reyde/PycharmProjects/Liderws/Lider_ws.py", line 48, in <module>
browser21 = webdriver.Chrome(executable_path=rutaChromeDriver)
File "C:UsersreydePycharmProjectsLiderwsvenvlibsite-packagesseleniumwebdriverchromewebdriver.py", line 68, in __init__
self.service.start()
File "C:UsersreydePycharmProjectsLiderwsvenvlibsite-packagesseleniumwebdrivercommonservice.py", line 88, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'Liderws' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Process finished with exit code 1

该错误确实表明 Web 驱动程序具有错误的权限。ChromeDriver的路径是否正确?尝试使路径如下所示:

browser21 = webdriver.Chrome(executable_path=C:Webdriverschromedriver.exe)

或者您保存了 chromedriver 的任何地方,但请确保路径直接指向 exe。

尝试重新下载最新的ChromeDriver,并将其放在所需的文件夹中。不要忘记将其添加到系统路径,而不仅仅是用户。

最新更新