コード例 #1
0
    def test_jquery_re(self):
        urls = set()
        merged_strings = self.get_file_contents('jquery.js')

        for x in URL_RE.findall(merged_strings):
            try:
                urls.add(URL(x[0]))
            except ValueError:
                pass

        return urls
コード例 #2
0
ファイル: link_extractor.py プロジェクト: z0r1nga/w3af
    def extract_full_urls(self):
        urls = set()
        merged_strings = ' \n'.join(self.get_strings())

        for x in URL_RE.findall(merged_strings):
            try:
                urls.add(URL(x[0]))
            except ValueError:
                pass

        return urls
コード例 #3
0
    def _extract_full_urls(self, doc_string):
        """
        Detect full URLs, which look like http://foo/bar?id=1
        """
        for url_mo in URL_RE.finditer(doc_string):
            if self._require_quotes:
                if not self._is_quoted(url_mo, doc_string):
                    continue

            try:
                url = URL(url_mo.group(0), encoding=self._encoding)
            except ValueError:
                pass
            else:
                self._re_urls.add(url)
コード例 #4
0
ファイル: re_extract.py プロジェクト: BioSoundSystems/w3af
    def _extract_full_urls(self, doc_string):
        """
        Detect full URLs, which look like http://foo/bar?id=1
        """
        for url_mo in URL_RE.finditer(doc_string):
            if self._require_quotes:
                if not self._is_quoted(url_mo, doc_string):
                    continue

            try:
                url = URL(url_mo.group(0), encoding=self._encoding)
            except ValueError:
                pass
            else:
                self._re_urls.add(url)