weixin_58628169 2021-10-22 21:07 采纳率: 0%
浏览 148

Mac Big Sur版本里安装geckodriver时放入/usr/bin/里失败

我想通过
from selenium import webdriver
driver = webdriver.Firefox()
读取火狐浏览器的网站,
报错:Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 74, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/liurukuo/Documents/测试.py", line 13, in
driver = webdriver.Firefox()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 175, in init
self.service.start()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 84, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
在安装geckodriver时一直出错(selenium已经安装成功4.0),python版本3.9,Mac版本 Big Sur11.2.2,下载的gecko driver版本geckodriver-v0.30.0-macos-aarch64,在将文件移动至/usr/bin/时出错,无法移入,关闭sip后通过 sudo 更改写入状态 ,显示
mount_apfs: volume could not be mounted: Permission denied
mount: / failed with 66
求解!或者用其他方式可以用python读译网站也可以

  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 创建了问题 10月22日

悬赏问题

  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决