Introduction to web debugging tools and development environment setup
python and selenium development environment build:
I. Download the python software:/
After downloading, install it and after successful installation, open IDLE (Python 3.6.2) as shown below:
As in the above figure type print("Hello Wrod!") in it and press enter, Hello Wrod! appears, indicating that the IDLE has been installed, the following open the dos command window and type Python and press enter. The following chart:
Information such as the python version number appears to indicate that python has been successfully installed. If an error message appears, you need to configure environment variables:
Add the installation directory of python in the environment system variable Path, for example: C:\Python35\Scripts;C:\Python35\, this is the directory installed in the C drive.
Second, install pip:/pypi/pip
After the download is completed, unzip it, open the dos command window and enter the unzipped folder (e.g. D:\pip-9.0.1, this is the unzipped pip folder) and enter the following information:
Enter the following information and press the Enter key to install, the installation directory is displayed after the installation: C:\Python35\Lib\site-packages\pip-9.0.1-py3.
Enter: in the dos command window again and press enter as shown below:
Then configure the environment variables by adding C:\Python35\Lib\site-packages\pip-9.0.1-py3. to the environment system variable Path (this is the directory installed on the C drive).
Open Open IDLE (Python 3.6.2) again and type import selenium and press enter as shown below:
If selenium is not found you can install it using the pip install -U selenium command.
The following uses selenium to open the firefox browser:
firstly/mozilla/geckodriver/releasesDownload, and after downloading, put the exe in the root python installation directory (the same directory as)
In IDLE (Python 3.6.2) type import selenium and press enter, then type from selenium import webdriver and press enter, and finally type browser=() and press enter to call firefox browser successfully. As shown in the picture:
Introduction to firefox front-end tools:
: A set of development class plug-ins for the FireFox browser
2. Role: to view the elements on the page, so as to locate according to its attributes
How to install fireBug, open FireFox browser and follow the instructions on the following picture to install it:
front-end technologyPresentation:
: The basis of a web page, a markup language that displays data;
: Front-end scripting language, interpreted language, adding interactive behavior to a page;
: Extended markup language for transferring and storing data
: Cascading style sheets, which are used to style documents such as HTML or XML.
The following opens the chrome browser using selenium (install Chrome webdriver):
1. Install chrome browser; 2. Download; 3. Put the downloaded file under the directory where Chrome browser is installed (e.g. C:\Users\Administrator\AppData\Local\Google\Chrome\Application) 4. Configure the environment variables, add C:\Users\ Administrator\AppData\Local\Google\Chrome\Application added to the environment system variable Path.
In IDLE (Python 3.6.2) type import selenium and press enter, then type from selenium import webdriver and press enter, and finally type b=() and press enter to call chrome successfully. As shown in the picture:
For more articles on python installation tutorials seeTutorial on installing python versions.
For more great book lists, clickEssential python programming book list
This is the whole content of this article.