| 434 | return element |
| 435 | |
| 436 | def select_all(self, selector, timeout=None): |
| 437 | if not timeout: |
| 438 | timeout = settings.MINI_TIMEOUT |
| 439 | self.__add_light_pause() |
| 440 | selector = self.__convert_to_css_if_xpath(selector) |
| 441 | if not self.is_element_present(selector): |
| 442 | time.sleep(1) |
| 443 | timeout = timeout - 1 |
| 444 | if timeout < 1: |
| 445 | timeout = 1 |
| 446 | try: |
| 447 | self.select(selector, timeout=timeout) |
| 448 | except Exception: |
| 449 | return [] |
| 450 | elements = self.loop.run_until_complete( |
| 451 | self.page.select_all(selector, timeout=0.1) |
| 452 | ) |
| 453 | updated_elements = [] |
| 454 | for element in elements: |
| 455 | element = self.__add_sync_methods(element) |
| 456 | updated_elements.append(element) |
| 457 | return updated_elements |
| 458 | |
| 459 | def find_elements(self, selector, timeout=None): |
| 460 | if not timeout: |