Began to study the library of selenium for python3 and ran into a problem.

>>>from selenium import webdriver >>>driver=webdriver.Firefox() Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x01B6FBD0>> Traceback (most recent call last): File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__ self.stop() File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop if self.process is None: AttributeError: 'Service' object has no attribute 'process' Traceback (most recent call last): File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 64, in start stdout=self.log_file, stderr=self.log_file) File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in __init__ restore_signals, start_new_session) File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child startupinfo) FileNotFoundError: [WinError 2] Не удается найти указанный файл During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__ self.service.start() File "C:\Users\Defernus\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

He killed the whole day, but did not understand how to solve it.

  • The message "AttributeError: 'Service' object has no attribute 'process'" is fairly transparent. From it and proceed when searching for errors. - Vlad from Moscow
  • 2
    "Can not find the specified file" and "geckodriver 'executable needs to be in PATH" error messages hint that the geckodriver not found — do you have geckodriver.exe on your machine and is its folder in %PATH% ? - jfs
  • there is a geckodriver in the PATH. - Defernus
  • @Defernus with .exe on the end? Try running the subprocess.Popen() command as specified in service.py on line 64. - jfs

0