child

def child(self, index: int)

Get child element with index.

Remarks:

  • The index starts from 0.

Parameters:
โ€ƒindex[Required]: int
โ€ƒโ€ƒ index specified, get the nth child

Returns:
โ€ƒWebElement object if it is found, or None if not

Example:

from clicknium import clicknium as cc, locator, ui

chrome_tab = cc.chrome.open("https://bing.com")

# get web element
ele = chrome_tab.find_element(locator.chrome.bing.search_sb_form_q)

# get element's first child
first_child = ele.child[0]

PreviousWebElementNextfind_element

What are your feelings
Updated on 30 August 2023