【发布时间】:2018-07-11 02:15:29
【问题描述】:
我对 Pycharm 或 Python 的了解不足以解决问题所在。似乎我觉得应该执行这段简单的代码,但我得到一堆乱七八糟的文本,对我没有任何意义。
其他使用 Selenium 的人收到此错误并知道如何修复它? 物理代码 -
"C:\Users\Noah Linton\PycharmProjects\EdgenuityBot\venv\Scripts\python.exe"
"C:/Users/Noah Linton/PycharmProjects/EdgenuityBot/Edgenuity Bot"
Traceback (most recent call last):
File "C:\Users\Noah Linton\PycharmProjects\EdgenuityBot\venv\lib\site-
packages\selenium\webdriver\common\service.py", line 76, in start
stdin=PIPE)
File "C:\Program Files (x86)\Microsoft Visual
Studio\Shared\Python36_64\Lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Program Files (x86)\Microsoft Visual
Studio\Shared\Python36_64\Lib\subprocess.py", line 997, in _execute_child
startupinfo)
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/Noah Linton/PycharmProjects/EdgenuityBot/Edgenuity Bot", line
3, in <module>
driver = webdriver.Firefox()
File "C:\Users\Noah Linton\PycharmProjects\EdgenuityBot\venv\lib\site-
packages\selenium\webdriver\firefox\webdriver.py", line 148, in __init__
self.service.start()
File "C:\Users\Noah Linton\PycharmProjects\EdgenuityBot\venv\lib\site-
packages\selenium\webdriver\common\service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver'
executable needs to be in PATH.
Process finished with exit code 1
执行代码
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://auth.edgenuity.com/Login/Login/Student")
button = driver.find_element_by_id('LoginSubmit')
button.click()
【问题讨论】:
-
错误是...?请提供确切的错误和相关代码。
-
对不起!我在中添加了截图
-
Trace back 是 python 返回错误/异常的方式。在此处发布它所说的内容以及相关的 sn-p 代码可能会产生您的答案。
-
我更新了显示相关代码
标签: python selenium firefox selenium-webdriver geckodriver