Building a SELENIUM+PYTHON+ECLIPSE development environment

Source: Internet
Author: User

  1. Download and install python, download "Python-2.7.9.msi" can be installed directly after
  2. Download install setuptools, download setuptools-11.3.1, use the command prompt to go to the location of setup.py in the installation package, execute setup.py install, perform the installation
  3. Download the install PIP tool, download pip-6.0.6, use the command prompt to go to the location of setup.py in the installation package, execute setup.py install, perform the installation
  4. Download install selenium, download selenium-2.44.0, use the command prompt to go to setup.py location in the installation package, perform setup.py install
  5. Download browser driver, download IEDriverServer.exe, and Python.exe in the same directory can be
  6. Install the Java JDK and configure the environment variables, download the installation Jdk-6u43-windows-i586.exe, and configure the environment variables
  7. Download eclipse, and you can use it directly after you unzip it.
  8. Download and install pydev+2.7.1, after decompression, there are plugins and features two folders
    1. Create a folder called Eclipse and put the above two folders in it
    2. Build a folder named Wbpro, put the Eclipse folder into it, the general structure of the plugin, such as : Wbpro/eclipse/{plugins,features}
    3. {eclipse/extplugins,links}, 
    4. under the Links folder , create a txt text, written in: Path=extplugins/wbpro, note
    5. start Eclipse, click Window->preferences in the menu bar, and in the pop-up dialog, look left side of the navigation bar, if there is your plug-in name, such as Wbpro, congratulations on your plugin installation success!
  9. After the Pydev is installed, you need to configure the interpreter.

1. In the Eclipse menu bar, select Window > Preferences > Pydev > Interpreter –python>new , enter the installation path where thename and Python.exe are located, add the installed interpreter

2. Click OK to jump out of a window with a lot of checkboxes and select the option to join the system Pythonpath

3. You can generally use the default settings, click OK.

4. Click OK to save the configuration

  

10. Next, create a Python project.  

1. Go to Pydev perspective, in the Eclipse menu bar, select File > New > Project > Pydev > Pydev Project, New project: Pycase, click Next.

Note: If the CREATE default SRC folder and add it to the Pythonpath check box is not selected when creating the project, you need to pass File > New > Other > Source Fo Lder manually create a source code folder src.

2. Click Finish, as follows

3. Enter Pydev Perspective, in the Python package Explorer , right-click src, select New->pydev Package , enter the package name py

4. Click Finish, the Python package is created , and the __init__.py file is automatically generated, and the file contains no content.

  

5. After the Pydev package is created, right-click on the created Packages Py27, select New->pydevmodule, enter the modules name PYc ase1.py Finish. In this way, the Python module is built

11. Write a small item save as pycase1.py after pressing F11, select Python run to execute the script

  

#-*-coding:utf-8-*- fromSeleniumImportWebdriverImportTimedriver=Webdriver. Ie () Driver.get ('http://www.baidu.com') driver.implicitly_wait (20) driver.find_element_by_id ('kw'). Send_keys ("AA") driver.find_element_by_id ('su'). Click () time.sleep (5) Driver.quit ()

12. Okay, it's done.

Building a SELENIUM+PYTHON+ECLIPSE development environment

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.