From d56e4ed1d0090419c824e17f6220fc83d4e89fb8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 3 Feb 2024 20:39:39 +0100 Subject: [PATCH] Continued: - maybe there is no unsorted list or table at all --- fba/networks/lemmy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fba/networks/lemmy.py b/fba/networks/lemmy.py index 766e4dd..b65b28f 100644 --- a/fba/networks/lemmy.py +++ b/fba/networks/lemmy.py @@ -272,8 +272,14 @@ def fetch_instances(domain: str, origin: str) -> list: logger.debug("Checking %d containers ...", len(containers)) for header in containers: logger.debug("header[%s]='%s'", type(header), header) + table = header.find_next(["ul","table"]) - rows = header.find_next(["ul","table"]).findAll("a") + logger.debug("table[]='%s'", type(table)) + if table is None: + logger.warning("No unsorted list or table found,domain='%s' - EXIT!", domain) + return peers + + rows = table.findAll("a") logger.debug("Found %d instance(s) ...", len(rows)) for tag in rows: logger.debug("tag[]='%s'", type(tag)) -- 2.39.5