Mac Os+selenium2+firefox Driver +python3

Source: Internet
Author: User

This article is based on a previously written Chrome+selenium+python environment configuration, linked
Before writing selenium script, all use of Chrome browser, see a lot of people say that Firefox does not need to install additional driver to fit selenium, thought can run directly, but today installed selenium IDE environment, want to use the next Firefox browser, Just write a script to test it:

from selenium import webdriverimport timedriver = webdriver.Firefox()driver.get("")time.sleep(3)driver.quit()

Results hint:

Message: ‘geckodriver‘ executable needs to be in PATH. 

Refer to the chrome environment installation process to access the official website: the corresponding system browser driver, I downloaded the geckodriver-v0.11.1-macos.tar.gz, the extracted geckodriver moved to/usr /local/bin directory, rerun the script;

    raise exception_class(message, screen, stacktrace)selenium.common.exceptions.WebDriverException: Message: Missing ‘marionetteProtocol‘ field in handshake

The specific cause of the error is unknown, the Firefox upgrade to the Firefox 49.0.2, rerun the script, can run normally.

Mac Os+selenium2+firefox Driver +python3

Related Article

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: 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.