]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 3 Feb 2024 19:39:39 +0000 (20:39 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 3 Feb 2024 19:39:39 +0000 (20:39 +0100)
- maybe there is no unsorted list or table at all

fba/networks/lemmy.py

index 766e4dd59c73845e113703412a51e94866e0977e..b65b28f2fd4f9fae062cb65f018dbe5c32227de2 100644 (file)
@@ -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))