Selenium-webdriver-Positioning a group of elements

Source: Internet
Author: User

Eight methods:

Find_elementS_by_id () find_elements_by_name () find_elements_by_class_name () find_ Elements_by_tag_name () find_elements_by_link_text () find_elements_by_partial_link_ Text () find_elements_by_xpath () find_elements_by_css_selector ()

  

Instance:

From selenium import webdriverfrom time Import sleepdriver = Webdriver. Chrome () driver.get ("http://www.baidu.com") driver.find_element_by_id ("kw"). Send_keys ("Selenium") driver.find_ element_by_id ("su"). Click () Sleep (5)texts = Driver.find_elements_by_xpath ("//div/h3/a")for T in texts:    Print (T.text) driver.quit ()

  

Operation Result:

Seleniumselenium Tutorial-90 days from entry to high salary "learning must see" Selenium-web Browser automationselenium_ Baidu Encyclopedia Selenium-web Browser Automation official Website function Automation test Tool--selenium Automation Test tool Selenium get started-csdn blog Python crawler from Getting started to discarding (eight) the use of Selenium library-pytho..._ Blog Park Selenium Usage Details-however persuasive-blog Park Selenium Chinese network –selenium installation, selenium use, selenium Chinese 、... selenium-csdn download Selenium automated test resource collation ( Including all versions of Chrome, CHROME..._CSDN blog Automation test _2017 new automated test Selenium course selenium_ "0 basis" to proficiency as long as 4 months _ monthly salary is not the dream "Amazon" buy Selenium on Z.cn_ Amazon overseas buy big "hui" poly _ a key really.

  

Reference: http://www.testclass.net/selenium_python/elements/

Selenium-webdriver-Positioning a group of elements

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.