From 8b8c59c089d338b34f660c705de409ded0a37370 Mon Sep 17 00:00:00 2001 From: davidvanzessen Date: Fri, 17 Feb 2023 10:10:45 +0100 Subject: [PATCH] better cosmic parsing of cosm id page --- sources/cosmic.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sources/cosmic.py b/sources/cosmic.py index 1b2aad6..9a9baf2 100644 --- a/sources/cosmic.py +++ b/sources/cosmic.py @@ -1,6 +1,6 @@ from bs4 import BeautifulSoup -from search import parse_search +from search import parse_cdot, parse_pdot from .source_result import Source, SourceURL @@ -111,7 +111,14 @@ async def gene_cdot(self): self.html_links["main"] = SourceURL("Go", cosmic_variant_url) resp, cosmic_text = await self.async_get_text(cosmic_variant_url) - self.new_variant_data.update(parse_search(cosmic_text)) + + self.new_variant_data.update(parse_cdot(cosmic_text)) + if "cdot_ref" in self.new_variant_data: + self.new_variant_data["ref"] = self.new_variant_data["cdot_ref"] + if "cdot_alt" in self.new_variant_data: + self.new_variant_data["alt"] = self.new_variant_data["cdot_alt"] + + self.new_variant_data.update(parse_pdot(cosmic_text)) cosmic_count = aa_data[4] self.html_text = f"

Count: {cosmic_count}

"