0

How can i get the value of term_from and term_to from this html table.

enter image description here

asked May 3, 2021 at 21:16

1 Answer 1

1

If I understand you correctly, you know that your table row has the attributes term_from and term_to and you are interested in their values?
getAttribute on the element should to the trick. See here for the Java API: https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebElement.html#getAttribute(java.lang.String)

Edit: A bit more concretely in Python, assuming that driver is your webdriver instance, let's print out these attributes for every row:

table_body = driver.get_element_by_id("bertListTableBody")
rows = table_body.get_element_by_tag_name("tr")
for row in rows:
 print("term_from: ", row.get_attribute("term_from"))
 print("term_to: ", row.get_attribute("term_to"))
answered May 4, 2021 at 5:00
1

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.