错误“ Service.py”

时间:2018-06-27 12:43:21

标签: python selenium-webdriver pycharm

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

Traceback (most recent call last):
  File "C:\Users\reyde\PycharmProjects\Liderws\venv\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files (x86)\Python36-32\lib\subprocess.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:\Users\reyde\PycharmProjects\Liderws\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in __init__
    self.service.start()
  File "C:\Users\reyde\PycharmProjects\Liderws\venv\lib\site-packages\selenium\webdriver\common\service.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

1 个答案:

答案 0 :(得分:0)

该错误确实表明该网络驱动程序具有错误的权限。 ChromeDriver的路径正确吗?尝试使路径类似于:

browser21 = webdriver.Chrome(executable_path=C:\Webdrivers\chromedriver.exe)

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

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