find_element returns the first found element by the attribute `selector` shortcut to `driver.find_element(By.CSS_SELECTOR, ...)`. args: - attribute: the attribute type to search for, aligns with the Selenium API's `By` class. default "CSS_SELECTOR" val
(self, selector, attribute="CSS_SELECTOR")
| 243 | self.driver.save_screenshot(f"{target}/{name}_{self.session_id}.png") |
| 244 | |
| 245 | def find_element(self, selector, attribute="CSS_SELECTOR"): |
| 246 | """find_element returns the first found element by the attribute `selector` |
| 247 | shortcut to `driver.find_element(By.CSS_SELECTOR, ...)`. |
| 248 | args: |
| 249 | - attribute: the attribute type to search for, aligns with the Selenium |
| 250 | API's `By` class. default "CSS_SELECTOR" |
| 251 | valid values: "CSS_SELECTOR", "ID", "NAME", "TAG_NAME", |
| 252 | "CLASS_NAME", "LINK_TEXT", "PARTIAL_LINK_TEXT", "XPATH" |
| 253 | """ |
| 254 | return self.driver.find_element(getattr(By, attribute.upper()), selector) |
| 255 | |
| 256 | def find_elements(self, selector, attribute="CSS_SELECTOR"): |
| 257 | """find_elements returns a list of all elements matching the attribute |
no outgoing calls