0
我試圖用硒啓動谷歌瀏覽器,但我得到一個錯誤 這裏是我的代碼:硒webdriver.firefox()錯誤
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.title
這裏是錯誤:
Traceback (most recent call last):
File "functional_tests.py", line 5, in <module>
browser = webdriver.Firefox(firefox_binary=binary)
File "C:\Python27\lib\site-
packages\selenium\webdriver\firefox\webdriver.py", line 140, in __init__
self.service.start()
File "C:\Python27\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.
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x03D51FD0>> ignored
有什麼幫助嗎?
我讀之前,我問..這不是一樣的錯誤 –