Workaround, check the environment:
Python 2.7.10
Firefox version 46
Selenium 2.53.6
Note: The Firefox automatic update is turned off, otherwise the selenium use case may not be executed after an automatic upgrade.
The error is as follows:
Macbookpro:github apple$ Python3 Test.pytraceback (most recent call last): File "/library/frameworks/python.framework/ versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/service.py ", line-up, in Start Stdout=self.log_ File, stderr=self.log_file) file "/library/frameworks/python.framework/versions/3.4/lib/python3.4/subprocess.py", Line 859, in __init__ restore_signals, start_new_session) File "/library/frameworks/python.framework/versions/3.4/lib /python3.4/subprocess.py ", line 1457, 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 EXCEP tion Occurred:traceback (most recent): File ' test.py ', line 4, <module> browser = Webdriver. Firefox () File "/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/selenium/webdriver /firefox/webdriver.py ", line $, in __init__ Self.service.start () FiLe "/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/ service.py ", line Bayi, in Start Os.path.basename (Self.path), self.start_error_message) Selenium.common.exceptions.WebDriverException:Message: ' geckodriver ' executable needs to is in PATH. Exception ignored in: <bound method service.__del__ of <selenium.webdriver.firefox.service.service object at 0x1005f8198>>traceback (most recent): File "/library/frameworks/python.framework/versions/3.4/lib/ python3.4/site-packages/selenium/webdriver/common/service.py ", line 173, in __del__ self.stop () File"/Library/Framew orks/python.framework/versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/service.py ", line 145, In Stop if self.process are none:attributeerror: ' Service ' object has no attribute ' process '
?
This question is the same type of problem as the one previously summarized:
Http://www.cnblogs.com/samren/p/6001779.html
On Mac Systems, Firefox and Selenium are incompatible