How to build python+selenium development environment Tutorial

Source: Internet
Author: User
This article is mainly for everyone in detail introduced the Python+selenium development environment construction of graphic tutorials, with a certain reference value, interested in small partners can refer to

Introduction to Web Debugging tools and development environment building

Python and Selenium development environment build:

First, download python software:https://www.python.org/

After downloading, install, install, open idle (Python 3.6.2), such as:

If you enter print ("Hello wrod!") Press ENTER to appear Hello wrod!, indicating that the idle has been installed, the following Open DOS command window input python press ENTER. Such as:

Information such as the Python version number appears indicating that Python has been installed successfully. If an error message occurs, you need to configure the environment variable:

Add the Python installation directory to the Environment system variable path, for example: C:\Python35\Scripts; C:\Python35\, this is the directory installed on the C drive.

Second, install PIP:https://pypi.python.org/pypi/pip

After the download is done, open the DOS command window into the folder you just unzipped (for example: D:\pip-9.0.1, this is the PIP folder after decompression) Enter the following information:

Enter the following information and press ENTER to install, after installation, the installation directory is displayed: C:\Python35\Lib\site-packages\pip-9.0.1-py3.5.egg

Again DOS command Window input: Pip.exe Press ENTER, such as:

Then configure the environment variables to add C:\Python35\Lib\site-packages\pip-9.0.1-py3.5.egg in the Environment system variable path (this is the directory installed on the C drive).

Open again open idle (Python 3.6.2) input import Selenium press ENTER, such as:

If not found selenium can be installed using the PIP install-u Selenium command

Use selenium to open the Firefox browser below:

First to https://github.com/mozilla/geckodriver/releases download Geckodriver.exe, after downloading the exe into the Python installation root directory (and python.exe the same directory)

In the Idle (Python 3.6.2), enter import Selenium press ENTER, then enter from selenium import webdriver press ENTER, and finally type Browser=webdriver. Firefox () Press the ENTER key to successfully call the Firefox browser.

Introduction to the Firefox Front end tool:

A set of development class plugins under the 1.firebug:firefox browser

2. Function: View the elements on the page to locate them according to their properties

How to install Firebug, open the Firefox browser to install on-chip operation:

Front-End Technology Introduction:

1.html: The basis of a Web page is a markup language that displays data;

2.JS: Front-end scripting language, interpreted language, add interactive behavior to the page;

3.xml: Extended Markup Language for transmitting and storing data

4.CSS: Cascading style Sheets for presentation of file styles such as HTML or XML

Use selenium to open the Chrome browser (Install Chrome webdriver):

1. Install Chrome browser, 2. Download chromedriver.exe;3. Place the downloaded Chromedriver.exe file under the Chrome browser directory (for example: C:\Users\Administrator\AppData\ local\google\chrome\application) 4. Configure the environment variables to C:\Users\Administrator\AppData\Local\Google\Chrome\ The application is added to the environment system variable path.

In the Idle (Python 3.6.2), enter import Selenium press ENTER, then enter from selenium import webdriver press ENTER, and finally type B=webdriver. Chrome () presses the ENTER key to successfully invoke the Chrome browser.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.