input_el = driver.find_element_by_name('A') td_p_input = input_el.find_element_by_xpath('..')
element = driver.find_element(By.ID, "id1") parent_element = element.find_element(By.XPATH, "..")