python - Python Selenium geckodriver 路径
问题描述
我的脚本看起来是这样的:
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/bin/geckodriver.exe')
driver.get('http://inventwithpython.com')
有这样的错误:
Traceback (most recent call last):
File "/home/natalia/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "slm.py", line 4, in <module>
driver = webdriver.Firefox(executable_path='/bin/geckodriver.exe')
File "/home/natalia/.local/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
File "/home/natalia/.local/lib/python3.5/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: 'geckodriver.exe' executable may have wrong permissions.
我把 geckodriver 放到文件夹 bin.. 现在我不知道该怎么办。请给ma一个建议。
解决方案
推荐阅读
- laravel - 如何使用单个登录表单在 laravel 中创建多重身份验证
- stored-procedures - 当通过 pl/sql 过程数据将 csv 文件作为附件发送时,附件中的数据被截断并且缺少对齐
- python - 如何根据列名将数据框拆分为多个数据框
- java - 如何从 Docker 上的命令行下载 Oracle JDK
- android - [Android]react-native-share:如何将图像分享到特定手机号码上的whatsapp
- vue.js - 动态地将新字段添加到 b-table [Vue.js]
- crop - 使用TextureView播放视频,如何使用Matrix裁剪指定RectF的视频?
- mysql - 如何删除标识符中的前导零,例如“1.2.03.4”
- php - 不断运行 Php 脚本,如果作为 Windows 服务连接到互联网,则将数据插入 xampp 服务器
- c++ - 无法加载犰狳立方体
使用 RcppArmadillo 时