BrowserTab.find_elements_by_css_selector

def find_elements_by_css_selector(
self,
css_selector: str,
timeout: int = 30
) -> List[WebElement]

In the active browser, find elements by the given CSS selector.

Parameters:
css_selector[Required]: str
   The CSS selector to find the element.
timeout: int
   Timeout for the operation, the unit is second, and the default value is 30 seconds.

Returns:
 List of WebElement objects.

Example:


from clicknium import clicknium as cc

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

# find elements by CSS selector
webelements = chrome_tab.find_elements_by_css_selector("IMG")
print("count: " + str(len(webelements)))
for i in range(3):
webelements[i].highlight()

Previousfind_elements_by_xpathNextis_existing

What are your feelings
Updated on 29 August 2023