-1
嗨,大家好,我需要帮助。如何使用硒和geckodriver设置python 3.6.2?
所以我有最新版本的蟒蛇,我能够推动pip安装硒。当我运行脚本它说这个消息
Traceback (most recent call last):
File "C:\Users\huHMONGous\Desktop\Python 3.6\Scripts\new.py", line 4, in <module>
driver = webdriver.Firefox()
File "C:\Users\huHMONGous\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 142, in __init__
self.service.start()
File "C:\Users\huHMONGous\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
我有Windows 10.我已经下载geckodriver-v0.18.0-win64zip。我提取它并复制并粘贴到用户变量和系统变量路径中,但它仍然不起作用。任何人都可以请帮忙?我使用记事本+ +和命令提示符下运行我的代码
代码我试图运行
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.youtube.com")
不需要说**谢谢**。当你选择最佳**答案**作为**解决方案**给你的问题和** Upvote **时,你说**'谢谢'**答案是**'对你有用的**。谢谢 – DebanjanB
重复,一个简单的谷歌搜索的错误,我发现[这](https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path)和[this](https://stackoverflow.com/questions/40188699/webdriverexception-message-geckodriver-executable-needs-to-be-in-path)。在提出问题之前,请尝试搜索自己。 – Zcode