I am on OS Sierra and I am running Python 3.5.2. I have selenium installed, and I'm following a book called Automating Boring Tasks Using Python
My code
from selenium import webdriver >>> browser = webdriver.Firefox()
I keep getting an error
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 64, in start stdout=self.log_file, stderr=self.log_file) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 947, in __init__ restore_signals, start_new_session) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> browser = webdriver.Firefox() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__ self.service.start() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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.
I searched for a lot of solutions to solve my problem. Many people have the same problem .. but none of the solutions work. I have a geckodriver copied everywhere in Python folders. I tried using the terminal and I tried to specify the path in the code and it still gives me errors. Hope someone can help me. I apologize if this is the wrong format, I donβt know what I'm doing.
source share