def find_elements_recursive(self, by, value):
        """
        find elements in all frames
        this is a generator function, which is needed
            since if it would return a list of elements, they
            will be stale on arrival.
        using generator, when the element is returned we are in the correct frame
        to use it directly
        Args:
            by: By
            value: str
        Returns: Generator[webelement.WebElement]
        """
        def search_frame(f=None):
            if not f:
                # ensure we are on main content frame
                self.switch_to.default_content()
            else:
                self.switch_to.frame(f)
            for elem in self.find_elements(by, value):
                yield elem
            # switch back to main content, otherwise we will get StaleElementReferenceException
            self.switch_to.default_content()

        # search root frame
        for elem in search_frame():
            yield elem
        # get iframes
        frames = self.find_elements('css selector', 'iframe')

        # search per frame
        for f in frames:
            for elem in search_frame(f):
                yield elem

        find elements in all frames
        this is a generator function, which is needed
            since if it would return a list of elements, they
            will be stale on arrival.
        using generator, when the element is returned we are in the correct frame
        to use it directly
        Args:
            by: By
            value: str
        Returns: Generator[webelement.WebElement]
        
src/undetected_chromedriver/__init__.py