there are multiple Tables on the Site with changing IDs, only the active one is Clickable, so i am test like this for the correct one:
def table_test(text):
rows = driver.find_elements(By.XPATH, '//table/tbody/tr/td[2]')
for row in rows:
if row.text == text:
try:
row.click()
break
except:
pass
So far this Code works, maybe there is a nicer way for this?
My Main Question is: Each table on the Site got an Selection Field after, how can i identify the correct Selection Field also with changing IDs, after the correct table is found? Can't use the same Method due each Selection Field is useable even it is not the active one.
When i try to find the next Select Field after i found the correct Row, the first Selection Field in the Document is found - so the wrong one.
element = row.find_element(By.XPATH, '//following-sibling::select')