Home > Article > Backend Development > Graphical tutorial on setting up python and selenium development environment
Introduction to web debugging tools and development environment setup
##Python and selenium development environment setup:
1. Download the python software After downloading, install it. After the installation is successful, open IDLE (Python 3.6.2), As shown below: As shown above, enter print("Hello Wrod!") and press Enter. Hello Wrod! appears, indicating that IDLE has been installed. Open it below. Enter Python in the dos command window and press Enter. As shown below: #The python version number and other information appear indicating that python has been installed successfully. If an error message appears, you need to configure the environment variables: Add the python installation directory to the environment system variable Path, for example: C:\Python35\Scripts;C:\Python35\, this is installed on the C drive Directory. 2. Install pip After the download is complete, unzip it, open the dos command window and enter the folder you just decompressed (such as: D:\pip- 9.0.1, this is the unzipped pip folder) Enter the following information: Enter the following information and press Enter to install. After the installation is completed, the installation directory will be displayed. For: C:\Python35\Lib\site-packages\pip-9.0.1-py3.5.egg Then enter: pip.exe in the dos command window and press Enter, as shown below: Then configure the environment variables and add C:\Python35\Lib\site-packages\pip-9.0.1-py3.5.egg to the environment system variable Path (this is installed in directory on C drive). Open IDLE (Python 3.6.2) again, enter import selenium and press Enter, as shown below:##If selenium is not found, you can use pip install -U selenium command installation
Use selenium to open the firefox browser:
First download geckodriver.exe, and after downloading, put the exe into the python installation root directory (same as python.exe Directory)
Enter
import seleniumin IDLE (Python 3.6.2) and press Enter, then enter from selenium import webdriverPress Enter, and finally enter browser=webdriver.Firefox()Press Enter to successfully call the firefox browser. As shown in the picture:
# #firefox front-end tool introduction:
#1.fireBug: a set of development plug-ins under the FireFox browser
2. Function: View the elements on the page and locate them according to their attributes
How to install fireBug, open the FireFox browser and follow the instructions in the following picture to install it That’s it:
# Introduction to front-end technology:
1.html: The basis of a web page is a markup language that displays data;
2.JS: front-end scripting language, interpreted language, adding interactive behaviors to the page;
# #3.xml: Extended markup language, used to transmit and store data
##4.css: Cascading style sheet, used to express HTML or XML and other file styles
Open selenium below##chrome Browser (install Chrome browser webdriver):
1. Install chrome browser; 2. Download chromedriver.exe; 3. Place the downloaded chromedriver.exe file under the directory where Chrome browser is installed (such as: C:\Users\Administrator\AppData\Local\Google\Chrome\Application) 4. Configure environment variables and add C:\Users\Administrator\AppData\Local\Google\Chrome\Application to the environment system variable Path. In IDLE (Python 3.6.2), enterimport selenium and press Enter, then enter from selenium import webdriverPress Enter, and finally enter b=webdriver.Chrome()Press the Enter key to successfully call the chrome browser. As shown in the picture:
##
The above is the detailed content of Graphical tutorial on setting up python and selenium development environment. For more information, please follow other related articles on the PHP Chinese website!