From: Roland Häder Date: Tue, 11 Jul 2023 06:22:04 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=584e30f2e441cd2509f03d9865ffa08e1ad54cef;p=fba.git Continued: - maybe does not contain any header at all? --- diff --git a/fba/networks/lemmy.py b/fba/networks/lemmy.py index 18cf2c4..5700742 100644 --- a/fba/networks/lemmy.py +++ b/fba/networks/lemmy.py @@ -152,9 +152,13 @@ def fetch_blocks(domain: str, nodeinfo_url: str) -> list: logger.debug("Checking %d header(s) ...", len(headers)) for header in headers: logger.debug("header[]='%s'", type(header)) - content = header.find(["h2", "h3", "h4", "h5"]).contents[0] + content = header.find(["h2", "h3", "h4", "h5"]) + + logger.debug("content[%s]='%s' - BEFORE!", type(content), content) + if content is not None: + content = content.contents[0] + logger.debug("content[%s]='%s' - AFTER!", type(content), content) - logger.debug("content[%s]='%s'", type(content), content) if content is None: logger.debug("domain='%s' has returned empty header='%s' - SKIPPED!", domain, header) continue