Trying to get an element (text) from a table using XPATH and then print it, but got the following error:
NoSuchElementException: Message: no such element: Unable to locate element.
I have waited time but got the same error. How can I get the text?
I've used the following code:
account = WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="ctl00_lc_ucLeftMenu_li_1_4"]/a[2]')))
account.click()
time.sleep(3)
portfolio = WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="ctl00_lc_ucLeftMenu_leaf_2_35"]')))
portfolio.click()
time.sleep(3)
sold = driver.find_element_by_xpath('//*[@id="37ef7b7a-3a62-4d56-a479-29c99031de7e"]/table/tbody/tr[8]/td[5]')
print('The amount is: {}'.format(sold.text))
sold1 = float(sold.text)
Please refer to the attached file- looking to get the highlighted text.

td, but that is not the point for the error - Could you improve your question, please and provide some code as text not image.