From b358f590a182661e58d6447e70f7730158e4d578 Mon Sep 17 00:00:00 2001 From: gongzt Date: Mon, 30 Aug 2021 10:43:46 +0800 Subject: [PATCH] =?UTF-8?q?bugliza=E4=B8=AD=E8=8E=B7=E5=8F=96=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=97=B6=E8=A7=A3=E6=9E=90json=E7=9A=84=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A5=E5=8F=8Anvd=E3=80=81debian=E7=AD=89=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E4=BF=A1=E6=81=AF=E7=9A=84=E8=A7=A3=E6=9E=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cve-agency-manager/cve_tracking/src/cve/pipe.py | 1 + .../cve_tracking/src/cve/plantform.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cve-agency-manager/cve_tracking/src/cve/pipe.py b/cve-agency-manager/cve_tracking/src/cve/pipe.py index f36e452..7990945 100644 --- a/cve-agency-manager/cve_tracking/src/cve/pipe.py +++ b/cve-agency-manager/cve_tracking/src/cve/pipe.py @@ -81,6 +81,7 @@ class FileHandle: download_failed = [] finds = [] find_path = {} + cve_dict=dict() for line in file.readlines(): if "cve information" in line.lower(): cve_info = line.replace("CVE Information : ", "") diff --git a/cve-agency-manager/cve_tracking/src/cve/plantform.py b/cve-agency-manager/cve_tracking/src/cve/plantform.py index 9767226..c2857cd 100644 --- a/cve-agency-manager/cve_tracking/src/cve/plantform.py +++ b/cve-agency-manager/cve_tracking/src/cve/plantform.py @@ -287,7 +287,7 @@ class Nvd(Crawl): other_urls = set() pkg = Crawl._re_escape(pkg) - soup = BeautifulSoup(resp_str, "html.parser") + soup = BeautifulSoup(resp_str, "lxml") urls = [ res.text for res in soup.find_all( @@ -363,7 +363,8 @@ class Debian(Crawl): patch_urls = [] other_urls = [] - soup = BeautifulSoup(response.text, "html.parser") + soup = BeautifulSoup(response.text, "lxml") + pre = soup.pre if pre: @@ -550,9 +551,12 @@ class Bugzilla(Crawl): """ pulls = [] - for _, comment in comments["bugs"].items(): - for comment_info in comment["comments"]: - pulls.extend(re.findall(URL_REGEX, comment_info["text"])) + try: + for _, comment in comments["bugs"].items(): + for comment_info in comment["comments"]: + pulls.extend(re.findall(URL_REGEX, comment_info["text"])) + except (KeyError,Exception): + pass return pulls def parse_comments(self, response, **kwargs): -- Gitee