The error code is as follows:
File "/usr/local/lib/python2.7/dist-packages/selenium-3.0.0b2-py2.7.egg/selenium/webdriver/firefox/webdriver.py ", line up, in __init__
Self.service.start ()
File "/usr/local/lib/python2.7/dist-packages/selenium-3.0.0b2-py2.7.egg/selenium/webdriver/common/service.py", Line +, in start
Os.path.basename (Self.path), self.start_error_message)
Selenium.common.exceptions.WebDriverException:Message: ' geckodriver ' executable needs to is in PATH.
Exception attributeerror: "' Service ' object has no attribute ' process '" in <bound method service.__del__ of <seleniu M.webdriver.firefox.service.service object at 0x7f753ad53390>> ignored
Download Geckodriver, below the link to my previous article.
Windows users are of course adding this to the PATH environment variable,
Mac users see that everyone has encountered this problem, did not solve,
Put this geckodriver in a position, and then
From selenium import Webdriver
Import time
Dr = Webdriver. Firefox (Executable_path = '/users/jinwenxin/desktop/pythonpractice/geckodriver ')
Time.sleep (5)
print ' Browser would close. '
Dr.quit ()
print ' Browser is close '
To teach you a way, I used to execute the help under Python (Webdriver. Firefox) Enter, so you know what parameters to pass. Hello everyone, I am only 8,000 of the monthly salary of three years of testing experience. But it's only temporary. Come on! The future, the chance!
Kim II elder brother, I am gold two elder brother.
Links: https://www.zhihu.com/question/49568096/answer/127226689
Source: Know
Copyright belongs to the author, please contact the author for authorization.
"Selenium 3" Mac under test environment build Firefox 47+ Gecko Driver mac