Environment Preparation:
Operating system: Windows
Python version: Python3.6
Selenium Installation:
Method 1: Command-line installation (open cmd)
Pip Install Selenium
Method 2: Download the WHL package and install it manually (if the command line download is slow or cannot be downloaded)
Selenium: Point me into
Once the download is complete, open the command line and enter Pip install to directly drag the file into the command line window
C:\>pip Install SELENIUM-3.4.2-PY2.PY3-NONE-ANY.WHL
After the installation is complete, launch Python, import the Selenium package imports Selenium , no error indicates the installation is successful
Browser-driven Installation:
Chrome drive: Dot me into
Firefox driver: Click me to enter
Here is only the two common browser driver download, after the download is complete, the D packing directory to create a new driver folder, and then put Chromedriver.exe,geckodriver.exe, under the driver file path, and finally add the path to the environment variable
Verify:
Note: Firefox + Selenium 3.4.0~3.4.2 has a bug, problem address: https://github.com/SeleniumHQ/selenium/issues/3884
Just verify Chrome + Selenium here
1 from Import Webdriver 2 >>> driver = webdriver. Chrome ()3 >>> driver.get ('http://www.baidu.com/')
Results such as:
Note: "Chrome: Is under the control of the automated test software. ", this does not know how to remove, if there is know please tell me, O (∩_∩) o Thank you
Attached: Chromedriver and Chrome version mapping table (updated to v2.29)
Chromedriver version |
supported versions of Chrome |
v2.29 |
v56-58 |
v2.28 |
v55-57 |
v2.27 |
v54-56 |
v2.26 |
V53-55 |
v2.25 |
V53-55 |
v2.24 |
v52-54 |
v2.23 |
v51-53 |
v2.22 |
v49-52 |
v2.21 |
V46-50 |
v2.20 |
v43-48 |
v2.19 |
v43-47 |
v2.18 |
v43-46 |
v2.17 |
v42-43 |
v2.13 |
V42-45 |
v2.15 |
v40-43 |
v2.14 |
V39-42 |
v2.13 |
v38-41 |
v2.12 |
V36-40 |
v2.11 |
V36-40 |
v2.10 |
V33-36 |
v2.9 |
V31-34 |
v2.8 |
V30-33 |
v2.7 |
V30-33 |
v2.6 |
V29-32 |
v2.5 |
V29-32 |
v2.4 |
V29-32 |
|
|
|
|
Selenium+python3 Environment Configuration