Issue
I have a table and I want to click every checkbox on a row containing the word empty. The checkbox is a child of a sibling in the HTML-code (I hope I'm using the correct terms). Screenshot of HTML-code.
I've managed to make a list of of all elements containing empty with this:
empty = driver.find_elements_by_xpath("//*[contains(text(),'empty')]")
How can I use this list to find the checkbox in the same row? I'm using Selenium with Python.
Solution
try one of these this xpath :
//tr[td[contains(text(),'empty')]]//input
//td[contains(text(),'empty')]/preceding-sibling::td/input
Answered By - Yevhen B
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.