def find(self): webelements = self._collection() filtered = [ webelement for webelement in webelements if is_matched(self._condition, webelement) ] return filtered
def find(self): for webelement in self._collection(): if is_matched(self._condition, webelement): return webelement raise NoSuchElementException('Element was not found by: %s' % (self._condition, ))