"Selenium 3" Mac under test environment build Firefox 47+ Gecko Driver mac

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.