Selenium文档

官网文档

WebElement有很多函数和属性

整理如下,供有个概念:

  • 函数
    • clear()
    • click()
    • find_element(by='id', value=None)
    • find_element_by_class_name(name)
    • find_element_by_css_selector(css_selector)
    • find_element_by_id(id_)
    • find_element_by_link_text(link_text)
    • find_element_by_name(name)
    • find_element_by_partial_link_text(link_text)
    • find_element_by_tag_name(name)
    • find_element_by_xpath(xpath)
    • find_elements(by='id', value=None)
    • find_elements_by_class_name(name)
    • find_elements_by_css_selector(css_selector)
    • find_elements_by_id(id_)
    • find_elements_by_link_text(link_text)
    • find_elements_by_name(name)
    • find_elements_by_partial_link_text(link_text)
    • find_elements_by_tag_name(name)
    • find_elements_by_xpath(xpath)
    • get_attribute(name)
    • get_property(name)
    • is_displayed()
    • is_enabled()
    • is_selected()
    • screenshot(filename)
    • send_keys(*value)
    • submit()
    • value_of_css_property(property_name)
  • 属性
    • id
    • location
    • parent
    • rect
    • screenshot_as_png
    • size
    • text
    • tag_name

更多内容详见官网文档:WebElement

其中:

  • find_element_by_link_text
  • find_element_by_partial_link_text

指的是标签alink,而其他标签是用不了的。

results matching ""

    No results matching ""