As pointed out before you can use
driver.find_element()
It returns the first found element within DOM tree which fits the xpath.
driver.find_elements()
returns all elements with specified xpath within DOM tree.
using find_element:
wait.until(EC.presence_of_element_located((By.XPATH, "//table//tbody//tr//a[@data-refid='recordId']")))
driver.implicitly_wait(20)
line_item = driver.find_element("xpath", "//table//tbody//tr//a[@data-refid='recordId']")
print(line_item)
using find_elements():
wait.until(EC.presence_of_element_located((By.XPATH, "//table//tbody//tr//a[@data-refid='recordId']")))
driver.implicitly_wait(20)
list_of_all_elements = driver.find_elements("xpath", "//table//tbody//tr//a[@data-refid='recordId']")
line_item = list_of_all_elements[0]
print(line_item)
This cheatsheet has a good section for locating list/table elements.
devhints.io/xpath