I'm trying to get the value between the div, as I am trying to continue the program once the code has been introduced correctly. However I can't seem to get the value from the element. Value is in this case '12345678'
<td id="TransaccionTesoreriaRetencionItems_NroComprobanteRetencion_1" height="22px">
<div style="width: 115px; overflow: hidden; cursor: pointer;">
12345678
</div>
</td>
Code image
To print the text 12345678 you can use either of the following locator strategies:
Using css_selector:
print(driver.find_element(By.CSS_SELECTOR, "td#TransaccionTesoreriaRetencionItems_NroComprobanteRetencion_1 > div").text)
Using xpath:
print(driver.find_element(By.XPATH, "//td[@id='TransaccionTesoreriaRetencionItems_NroComprobanteRetencion_1']/div").text)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With