Selenium ide & selenium RC note

Source: Internet
Author: User
Tags seleniumhq

Take Baidu map as an example to query the bus route between two addresses and use the python driverSelenium RC.

 

Prerequisites:

Http://seleniumhq.org/docs/05_selenium_rc.html#learning-the-api-Selenium RCStructure,Install sdks in various languages

Http://seleniumhq.org/docs/->Selenium ideUsage

 

 

Step 1: Use selenium ide To produce PythonCode

 

Base URL:

Http://map.baidu.com/ide only records the actions that are generated in the domain name specified by the base URL

Source:

The following code fills in selenium IDE in the order of commnd targe Value

Open/

Open current page

Click tab2

Click bus button

Type bussearchsta Intersection

Enter site

Type bussearachend Intersection

Enter site

 

Click // form [@ ID = 'form2']/Div [2]/input [1]

Click Baidu

Waitforelementpresent // P [@ ID = 'blinfo _ 0']

Waiting for Data

 

Step 2: Export Python

Select export as Python to obtain the Python code.

 

Step 3: Obtain HTML data in Python

Searchresult = self. Selenium. get_eval ("this.browserbot.getcurrentwindow().doc ument. getelementbyid ('route _ list'). innerhtml ")

 

 

 

 

 

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.