How to use Selenium ByChained in python?

Viewed 186

I would like to use Selenium's ByChained to create a locator that takes two or more locators. I've tried various versions of the following:

from selenium.webdriver.common.by import By, ByChained
myLocator = ByChained((By.CSS_SELECTOR, "selector_top_level"),(By.CSS_SELECTOR, "selector_bottom_level")

I can't for the life of me find the correct import statement. (Getting various versions of the following error:

has no attribute 'ByChained'

https://www.selenium.dev/selenium/docs/api/py/webdriver/selenium.webdriver.common.by.html#module-selenium.webdriver.common.by Does not mention ByChained however it seems to exist I just can't find where to import it from.

0 Answers
Related