2016-12-13 6 views
0

Python上のSeleniumがこのエラーメッセージを返しています。誰でも修正する方法を知っているだろうか?上記の例外の取り扱い中Python Seleniumエラー

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 

答えて

0

あなたがfrom hereをgeckodriverダウンロードし、それはあなたのPATH変数にであるディレクトリを配置する必要があります。どちらかと言うと、の引数としてgeckodriverへのパスをwebdriver.Firefox(executable_path='/path/to/geckodriver')

に渡す