0
Python上的Selenium正在返回此錯誤消息。誰會碰巧知道如何解決?Python Selenium Error
C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\python.exe "C:/Users/nvarga/PycharmProjects/HWIN/HWIN Account Spending Report.py" Traceback (most recent call last): File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 947, in init restore_signals, start_new_session) File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 1224, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified
在處理上述異常,另一個異常:
Traceback (most recent call last): File "C:/Users/nvarga/PycharmProjects/HWIN/HWIN Account Spending Report.py", line 127, in HWIN_Spending_Report(ID, Username, Password, 50) File "C:/Users/nvarga/PycharmProjects/HWIN/HWIN Account Spending Report.py", line 13, in HWIN_Spending_Report browser = webdriver.Firefox() File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in init self.service.start() File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\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 ignored in: > Traceback (most recent call last): File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 173, in del self.stop() File "C:\Users\nvarga\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 145, in stop if self.process is None: AttributeError: 'Service' object has no attribute 'process'
Process finished with exit code 1