-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