From: Roland Häder Date: Wed, 18 Oct 2023 21:27:43 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=387d817644970a3e09819dd3e663c548abe5a229;p=fba.git Continued: - more cases of empty strings --- diff --git a/fba/http/federation.py b/fba/http/federation.py index 92daf56..25ec633 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -286,7 +286,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: app_name = doc.find("meta", {"name" : "application-name"}) logger.debug("generator[]='%s',site_name[]='%s',platform[]='%s',app_name[]='%s'", type(generator), type(site_name), type(platform), type(app_name)) - if isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str): + if isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str) and platform.get("content") != "": logger.debug("Found property=og:platform, domain='%s'", domain) software = tidyup.domain(platform.get("content")) @@ -294,7 +294,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: if software is not None and software != "": logger.debug("domain='%s' has og:platform='%s' - Setting detection_mode=PLATFORM ...", domain, software) instances.set_detection_mode(domain, "PLATFORM") - elif isinstance(generator, bs4.element.Tag) and isinstance(generator.get("content"), str): + elif isinstance(generator, bs4.element.Tag) and isinstance(generator.get("content"), str) and generator.get("content") != "": logger.debug("Found generator meta tag: domain='%s'", domain) software = tidyup.domain(generator.get("content"))