MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / select

Method select

seleniumbase/core/sb_cdp.py:409–434  ·  view source on GitHub ↗

Similar to find_element().

(self, selector, timeout=None)

Source from the content-addressed store, hash-verified

407 return updated_elements
408
409 def select(self, selector, timeout=None):
410 """Similar to find_element()."""
411 if not timeout:
412 timeout = settings.SMALL_TIMEOUT
413 self.__add_light_pause()
414 selector = self.__convert_to_css_if_xpath(selector)
415 if (":contains(" in selector):
416 return self.find_element(selector, timeout=timeout)
417 failure = False
418 message = ""
419 try:
420 element = self.loop.run_until_complete(
421 self.page.select(selector, timeout=timeout)
422 )
423 except Exception:
424 failure = True
425 plural = "s"
426 if timeout == 1:
427 plural = ""
428 msg = "\n Element {%s} was not found after %s second%s!"
429 message = msg % (selector, timeout, plural)
430 if failure:
431 raise Exception(message)
432 element = self.__add_sync_methods(element)
433 self.__slow_mode_pause_if_set()
434 return element
435
436 def select_all(self, selector, timeout=None):
437 if not timeout:

Callers 15

select_allMethod · 0.95
get_parentMethod · 0.95
remove_elementMethod · 0.95
remove_from_domMethod · 0.95
send_keysMethod · 0.95
press_keysMethod · 0.95
typeMethod · 0.95
clear_inputMethod · 0.95
set_valueMethod · 0.95
get_element_rectMethod · 0.95

Calls 5

__add_light_pauseMethod · 0.95
find_elementMethod · 0.95
__add_sync_methodsMethod · 0.95

Tested by 1

test_scrape_bingMethod · 0.36