PyFunceble/iana.py
def _extensions(self):
        """
        Extract the extention from the given block.
        Plus get its referer.
        """

        upstream_lines = (
            Download(self.iana_url, return_data=True)
            .text()
            .split('<span class="domain tld">')
        )

        # We extract the different extension from the currently readed line.
        regex_valid_extension = r"(/domains/root/db/)(.*)(\.html)"

        for block in upstream_lines:
            if "/domains/root/db/" in block:
                # The link is in the line.

                # We try to extract the extension.
                matched = Regex(
                    block, regex_valid_extension, return_data=True, rematch=True
                ).match()[1]

                if matched:
                    # The extraction is not empty or None.

                    # We get the referer.
                    referer = self._referer(matched)

                    # We yield the matched extension and its referer.
                    yield (matched, referer)
def _extensions(self):
        """
        Extract the extention from the given block.
        Plus get its referer.
        """

        upstream_lines = (
            Download(self.iana_url, return_data=True)
            .text()
            .split('<span class="domain tld">')
        )

        # We extract the different extension from the currently readed line.
        regex_valid_extension = r"(/domains/root/db/)(.*)(\.html)"

        for block in upstream_lines:
            if "/domains/root/db/" in block:
                # The link is in the line.

                # We try to extract the extension.
                matched = Regex(
                    block, regex_valid_extension, return_data=True, rematch=True
                ).match()[1]

                if matched:
                    # The extraction is not empty or None.

                    # We get the referer.
                    referer = self._referer(matched)

                    # We yield the matched extension and its referer.
                    yield (matched, referer)
def _extensions ( self ) : upstream_lines = ( Download ( self . iana_url , return_data = True ) . text ( ) . split ( '<span class="domain tld">' ) ) # We extract the different extension from the currently readed line. regex_valid_extension = r"(/domains/root/db/)(.*)(\.html)" for block in upstream_lines : if "/domains/root/db/" in block : # The link is in the line. # We try to extract the extension. matched = Regex ( block , regex_valid_extension , return_data = True , rematch = True ) . match ( ) [ 1 ] if matched : # The extraction is not empty or None. # We get the referer. referer = self . _referer ( matched ) # We yield the matched extension and its referer. yield ( matched , referer )
Extract the extention from the given block.
        Plus get its referer.
Extract the extention from the given block . Plus get its referer .