python - 硒错误 firefox 82.0.3 win 10 64 位
问题描述
0.3 win 10 64 bit,我只是在写我的第一个 selenium,但它不成功,因为这个错误是我的代码
from time import sleep
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://www.instagram.com/')
sleep(5)
browser.close()
这是我的方式很长的错误
Traceback (most recent call last):
File "C:\Users\SuperUser_ROOT\Desktop\Projects\venv\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\SuperUser_ROOT\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\SuperUser_ROOT\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/SuperUser_ROOT/Desktop/Projects/TRANSpy.py", line 4, in <module>
browser = webdriver.Firefox()
File "C:\Users\SuperUser_ROOT\Desktop\Projects\venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "C:\Users\SuperUser_ROOT\Desktop\Projects\venv\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
解决方案
推荐阅读
- r - 多个向量的和
- c# - C# Visual Studio for mac:智能感知自动完成错误。禁用选项?
- javascript - readline.question 不会在循环内运行 X 次
- javascript - 我有两个按钮 onclick 更改文本按钮并且不保存我想使用 javascript 中的本地存储来保存更改
- css - 我可以强制滚动捕捉始终捕捉到剪切/可见元素的开头吗?
- android - 在 Android 10+ 中添加 802.1x 网络
- c++ - 错误:从 'const char*' 到 'char*' 的无效转换 [-fpermissive]
- python - 如何仅使用 CSV 文件中的一行来运行测试?
- powershell - Powershell:从 CSV 文件标题中获取列号
- angular - 从角度 11 中的 RxJS 存储获取数据后调用函数