Two installation methods for installing the Pydev plug-in:
1, Baidu search Pydev 2.4.0.zip, after download decompression, get plugins and Feature folder, copy two folders to eclipse directory, cover can.
When you are done restarting eclipse, if you see the Pydev component in the Eclipse menu Help->about eclipse->installation detail->plug-ins, the installation is successful.
2. Select the menu directly in Eclipse: Help-install New software. -add, enter http://pydev.org/updates, download and install.
Configuration PyDev
After installing the PyDev, the Python/jython interpreter needs to be configured and the configuration process is simple.
In the Eclipse menu bar, choose Window > Preferences > Pydev > Interpreter-python, where you configure the python/interpreter to add the installed interpreter. Here, Python is installed under the C:\Python27 path. Click New, select the Python interpreter python.exe, open a window with many checkboxes, select the path you want to add to the system PYTHONPATH , and click Ok.
Seventh Step: Execute Selenium instance
Next, let's create a Python project.
In the Eclipse menu bar, choose File > New > Project > Pydev > Pydev Project, New project:pythoncase, click Next.
Complete the following:
Create Python Packages and Modules
Next, start creating Python packages and modules in the project you just created.
Enter the Pydev perspective, in the Python package Explorer, right-click SRC, select New->pydev Package, and enter the package name Python27.
When you click the Finish,python package, it is created, and the __init__.py file is automatically generated, and the file contains no content.
Attention:
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 Folde R manually create a source code folder src.
After you create the Pydev package, right-click the created bundle, select New->pydev module, enter the module name pythoncase1.py Finish. In this way, the Python module is built.
Modify the pythoncase1.py content as follows:
#-*- conding=utf-8-*-
From selenium import Webdriver
if __name__ = = "__main__":
Driver = Webdriver. Firefox ()
Driver.implicitly_wait (30)
Driver.get ("http://www.google.com.hk")
Driver.find_element_by_name ("Q"). Send_keys ("Hello selenium!")
Driver.find_element_by_name ("Q"). Submit ()
Print ' Page title is: ', Driver.title
Driver.quit ()
Execute script
Run Run_selenium.bat and start the Selenium RC server. Right -click Pythoncase1.py,run as->python Run to perform the following successful results:
Python's development environment configuration-eclipse-pydev plug-in installation