(self, timeout=None, raise_error=True)
Args:
            timeout (float): timeout for query element, unit seconds
                Default 10s
            raise_error (bool): whether to raise error if element not found

        Returns:
            Element: UI Element

        Raises:
            WDAElementNotFoundError if raise_error is True else None
Args:
            timeout (float): timeout for query element, unit seconds
                Default 10s
            raise_error (bool): whether to raise error if element not found
Args : timeout ( float ) : timeout for query element unit seconds Default 10s raise_error ( bool ) : whether to raise error if element not found
def get(self, timeout=None, raise_error=True):
        """
        Args:
            timeout (float): timeout for query element, unit seconds
                Default 10s
            raise_error (bool): whether to raise error if element not found

        Returns:
            Element: UI Element

        Raises:
            WDAElementNotFoundError if raise_error is True else None
        """
        start_time = time.time()
        if timeout is None:
            timeout = self._timeout
        while True:
            elems = self.find_elements()
            if len(elems) > 0:
                return elems[0]
            if start_time + timeout < time.time():
                break
            time.sleep(0.5)

        if raise_error:
            raise WDAElementNotFoundError("element not found",
                                          "timeout %.1f" % timeout)
def get ( self , timeout = None , raise_error = True ) : start_time = time . time ( ) if timeout is None : timeout = self . _timeout while True : elems = self . find_elements ( ) if len ( elems ) > 0 : return elems [ 0 ] if start_time + timeout < time . time ( ) : break time . sleep ( 0.5 ) if raise_error : raise WDAElementNotFoundError ( "element not found" , "timeout %.1f" % timeout )