How to use find_element, get_attribute and get_text over iteration of elements after finding the elements? #3206
-
//<tr class="hidden-item ng-star-inserted" time_slot_rows = sb.driver.find_elements('tr.hidden-item.ng-star-inserted') if time_slot_rows: Does find_elements also include the child classes? If so, why do I keep getting mistakes in these get_text, get_attribute and find_element? I would be glad to be corrected |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When you find elements via |
Beta Was this translation helpful? Give feedback.
When you find elements via
find_elements
, those are Selenium WebElement objects (not SeleniumBase objects). You have to use the regular Selenium API if you have a Selenium WebElement object, which doesn't autodetect the selector type from the selector. In other words, you need to include theby
arg with your calls, eg:by="css selector
.