您的位置:首页 > 运维架构 > Linux

centos在selenium中使用Chromedriver时Permission denied,权限错误的解决方法

2019-03-28 15:46 309 查看

centos在selenium中使用Chromedriver时Permission denied,权限错误的解决方法

错误

Traceback (most recent call last):
File “/home/ly/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py”, line 76, in start
stdin=PIPE)
File “/usr/lib/python3.6/subprocess.py”, line 709, in init
restore_signals, start_new_session)
File “/usr/lib/python3.6/subprocess.py”, line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: ‘chromedriver’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/ly/Desktop/robot/day_06/01_try_selenium.py”, line 6, in
driver = webdriver.Chrome()
File “/home/ly/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py”, line 73, in init
self.service.start()
File “/home/ly/.local/lib/python3.6/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: ‘chromedriver’ executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Process finished with exit code 1

解决办法

终端
sudo chmod +x chromedriver
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐