Python 3.5 - “Geckodriver 可执行文件需要在 PATH 中" [英] Python 3.5 - "Geckodriver executable needs to be in PATH"
问题描述
我将 geckodriver.exe 添加到 PATH 中,正如您在 此图片 上看到的之后我重新启动了我的电脑.但错误仍然出现.
I added geckodriver.exe into PATH as you can see on this image and i restarted my computer after. But the error still show up.
这是我的代码:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://stackoverflow.com')
你知道我做错了什么吗?
Do you have clues about what I did wrong ?
推荐答案
在 Windows 10 中,将 Firefox 驱动程序替换为 chrome 驱动程序即可解决.driver = webdriver.Chrome()
In Windows 10 it can be solved after replacing Firefox driver with chrome driver.
driver = webdriver.Chrome()
下载 Visual Studio 2015、2017 和 2019https://aka.ms/vs/16/release/vc_redist.x86.exe 或 https://aka.ms/vs/16/发布/vc_redist.x64.exe 并根据您的操作系统进行安装.
Download Visual Studio 2015, 2017 and 2019 https://aka.ms/vs/16/release/vc_redist.x86.exe OR https://aka.ms/vs/16/release/vc_redist.x64.exe and install based on your Operating system.
下载 Chrome 驱动程序://chromedriver.storage.googleapis.com/index.html?path=79.0.3945.36/ 基于您的操作系统.
Download Chrome Driver from https://chromedriver.storage.googleapis.com/index.html?path=79.0.3945.36/ based on your operating system.
在 PATH 中添加 chrome 驱动程序
Add chrome drivers in your PATH
这篇关于Python 3.5 - “Geckodriver 可执行文件需要在 PATH 中"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!