There is a way to use the element_to_be_clickable method by passing as a parameter a webelement and not a locator (By) as can be done in Java.
The problem is because the element I want to wait for until it is clickable is obtained by looking for it in a relative way by xpath in another webelement.
<ul class="my-list">
<li>Coffee</li>
<li>Tea
<div class="acction">
click-me
</div>
</li>
<li>Milk</li>
<li>bread
<div class="acction">
click-me
</div>
</li>
</ul>
My Java code
var items = driver.findElementsByXPath("//ul[@class='my-list']//li");
items.forEach(item -> {
try {
var action = item.findElement(By.xpath(".//div[@class='acction']"));
wait.until(ExpectedConditions.elementToBeClickable(action)).click();
} catch (NoSuchElementException ignored) {
}
});
Is there a way I can do the same using selenium in python?