Selenium+eclipse+python Environment

Source: Internet
Author: User

1. Download and install the JDK, configure the environment variables;

2. Download and install Python;

3. Install Selenium, execute PIP install-u under the installed Python path D:\Program files\python34\scripts Selenium

4. Download Eclipse, install Pydev:help-install New software online in Eclipse. -add, input Http://pydev.org/updates

After the 5.pydev installation, configure the Python interpreter in Eclipse: Window > Preferences > Pydev > Interpreter-python. Click New to select the installed Python.exe

6.Eclipse, select File > New > Project > Pydev > Pydev project;

7. After the project is created, create a py file:

#-*-Conding=utf-8-*-

From selenium import Webdriver

if __name__ = = "__main__":

Driver = Webdriver. Firefox ()

Driver.implicitly_wait (30)

Driver.get ("http://www.baidu.com")

driver.find_element_by_id ("kw"). Send_keys ("Selenium")

driver.find_element_by_id ("su"). Submit ()

Driver.quit ()

Run.

Selenium+eclipse+python 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.