Written in the previous words: 2017 There are too many distractions and slack. Things are stagnant in many ways, and the end-of-year version is still a problem, deeply remorse and uneasy. Hope that the coming year will be serious, focus and perseverance.
A few days ago to change the computer, just reconfigure a variety of environments, but also want to re-learn the knowledge of automation.
What I want to record today is about the environment of selenium and python.
Actually, it's easy to say.
It's just a few steps.
1. Install Python (3.5.4)
2. Installing Selenium
3. Configure the browser driver
1. Python Installation
-Go to https://www.python.org/downloads/and find the version that needs to be downloaded, I chose 3.5.4
Web-based: Installed through the network, is to perform the installation before downloading Python through the network
Executable: Executable files, both to install the Python to download all the local installation
embeddable zip file:zip compressed file, Python packaged as a ZIP archive package
In fact, the content is the same, I choose a good, I chose EXE installation.
-Double-click to run after downloading well.
After the installation is complete, go to cmd to see if the Python installation is successful and if the Python version information is successfully printed, the installation is successful.
-Configure Environment variables
Right-click My Computer-Properties-Advanced system settings-environment variable-path
To write the installation path of Python
C:\xxx\Python\Python35
2. Installing Selenium
There are many ways to install the selenium, I use the PIP way
Enter the Python35\scripts directory
Shift-click the right mouse button-open the Powshell window here
Run pip Install Selenium
You can use the PIP list to view the installation after the installation is complete
3. Configure browser driver (Chrome only)
Download Chromedriver
The official website seems to be wall, find a mirror on the net
http://npm.taobao.org/mirrors/chromedriver/
The corresponding version is as follows
When the download is complete, place it in the Chrome installation directory and put the Chrome installation directory in the environment variable
Test code
from Import = webdriver. Chrome () driver.get('http://baidu.com')print(driver.title)
To run smoothly, you are done.
Win10 under the Selenium + Python environment setup