Because of the project, more recently used UFT to automate the test work, six months did not use selenium, so on their own computer reconfiguration of the selenium environment based on python3.x, the configuration process is generally as follows:
1. Selenium Installation
Selenium the environment configuration under Python is relatively simple, just install the selenium package in Python.
2. Webdriver Installation
However, Webdriver for different browsers need to be installed separately.
Prior to the use of python2, there is no separate driver for Firefox browser, but this discovery for Firefox, also need to install third-party drivers: geckodriver
Otherwise the error is:
Selenium.common.exceptions.WebDriverException:Message: ' geckodriver ' executable needs to is in PATH.
Exception attributeerror: "' Service ' object has no attribute ' process '"
After downloading the driver (http://docs.seleniumhq.org/download/), unzip the driver and place it in the Firefox directory, then add the path to the system environment variable path and restart the Python environment. You can complete the Webdriver installation
3. Other browsers
For Chromedriver, the installation process is similar, no longer repeat
After the installation is complete, you can simply use the following code to test the installation effect:
1 from Import Webdriver 2 3 Driver = webdriver. Firefox ()4 driver.get ("http://www.cnblogs.com/persistz/") #URL
Selenium+python Environment Configuration