]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 06:22:04 +0000 (08:22 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 06:22:04 +0000 (08:22 +0200)
- maybe does not contain any header at all?

fba/networks/lemmy.py

index 18cf2c474a5c5a35a0e4b91cc1608413a1d23087..5700742258697be57a44c4b63b97c9b75e56ea2d 100644 (file)
@@ -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