- My computer has been installed and configured python3.5 number of environmental variables
- Verify python installation without exception: in cmd type python, showing the installation of the version number python
- In the official website to download Firefox: https: //www.firefox.com.cn
- Download the corresponding version geckodriver: https: //github.com/mozilla/geckodriver/releases, and allowed to stand at geckodriver.exe python installation root directory, and the same level python.exe
- Open cmd, ready to install selenium
- Enter pip
- input command cmd line installation selenium
- >pip install selenium==2.53.6
- 100% until the progress display, the installation is complete
- Tips are available the new version is installed: python -m pip install --upgrade pip
- Check the selenium environment
- Enter the following statement to see whether to open firefox
-
python >>> from selenium import webdriver >>> webdriver.Firefox()
-
If you mistakenly entered as firefox, will be reported error
- Tip error sessionid, selenium updated version:
pip install
-
U selenium
-
- So far environment to build complete, open the Baidu home page
-
python >>> from selenium import webdriver >>>driver=webdriver.Firefox() >>>driver.get("https://www.baidu.com")