【发布时间】:2021-04-12 15:27:13
【问题描述】:
我在人脸识别项目中使用 chrome 驱动,但在下面的第 4 行出现错误。 如何授予 chromedriver.exe 权限?
代码:
data_path = '/content/drive/MyDrive/FaceRecognition/faces'
onlyfiles = [f for f in listdir(data_path) if isfile(join(data_path,f))]
url='https://www.naver.com/'
browser = webdriver.Chrome(r'/content/drive/MyDrive/FaceRecognition/chromedriver/chromedriver.exe')
================================================ ================================================== ===== 错误信息:
PermissionError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in start(self)
75 stderr=self.log_file,
---> 76 stdin=PIPE)
77 except TypeError:
4 frames
PermissionError: [Errno 13] Permission denied: '/content/drive/MyDrive/FaceRecognition/chromedriver/chromedriver.exe'
During handling of the above exception, another exception occurred:
WebDriverException Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in start(self)
86 raise WebDriverException(
87 "'%s' executable may have wrong permissions. %s" % (
---> 88 os.path.basename(self.path), self.start_error_message)
89 )
90 else:
WebDriverException: Message: 'chromedriver.exe' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
【问题讨论】:
-
你真的在 Unix 系统上使用 chromedriver.EXE 吗?
标签: python selenium selenium-webdriver selenium-chromedriver