🍺 Join Clicknium for quality support, growth opportunities, and a supportive community

WebElement.find_element_by_css_selector

def find_element_by_css_selector(
self,
css_selector: str,
timeout: int = 30
) -> WebElement

In the active browser, find element 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:
 WebElement object.

Example:


from clicknium import clicknium as cc

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

# find elements by CSS selector
element = chrome_tab.find_element_by_css_selector("#sb_form")

# find sub elements by CSS selector
webelement = element.find_element_by_css_selector("svg")
webelement.highlight()

Previousfind_element_by_xpathNextfind_elements

What are your feelings
Updated on 29 August 2023