为了账号安全,请及时绑定邮箱和手机立即绑定

FileNotFoundError: [Errno 2] 没有这样的文件或目录:

FileNotFoundError: [Errno 2] 没有这样的文件或目录:

潇湘沐 2021-07-16 18:31:09
我创建了一个测试脚本来使用 python 在 Eclipse 中打开一个 url 并得到以下错误:Traceback (most recent call last):  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start    stdin=PIPE)  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 769, in __init__    restore_signals, start_new_session)  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1516, in _execute_child    raise child_exception_type(errno_num, err_msg, err_filename)FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver': 'geckodriver'在处理上述异常的过程中,又发生了一个异常:Traceback (most recent call last):  File "/Applications/Eclipse.app/Contents/MacOS/C:\EclipseWorkspaces\csse120/PythonSeleniumProject/src/PythonSeleniumModule.py", line 13, in <module>    driver = webdriver.Firefox()  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__    self.service.start()  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 83, in start    os.path.basename(self.path), self.start_error_message)selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 我已经阅读了有关相关主题的堆栈溢出,但没有一个能回答/解决我的问题。请指教。谢谢你。
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 599 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号