""" """ def is_element_present(page, selector): try: page.wait_for_selector(selector, timeout=2000) return True except Exception: return False