I am using this for get a row in a table:
element = browser.find_element_by_xpath("//*[contains(text(),'Sample Text')]")
html_text = element.get_attribute('outerHTML')
this gives me <td>...</td> but I want <tr><td>...</td><td>...</td></tr>
How do I do this?
//tr[contains(.,'Sample Text')]or//tr[td[contains(text(),'Sample Text')]]HTMLalong with theouterHTMLwhich you are trying to retrieve.