]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 19 Jul 2023 11:05:14 +0000 (13:05 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 19 Jul 2023 11:05:14 +0000 (13:05 +0200)
- in case of database error (on their side), there is no navigation which
  lead here to a method invocation findAll() on NoneType

fba/commands.py

index ae92ef63c1e6e9a8f75d80f41f5d62130531702a..76525c3233aa4975da25f9f47c720dbf8cc412de 100644 (file)
@@ -473,7 +473,13 @@ def fetch_observer(args: argparse.Namespace) -> int:
         doc = bs4.BeautifulSoup(raw, features="html.parser")
         logger.debug("doc[]='%s'", type(doc))
 
-        items = doc.find("div", {"aria-labelledby": "navbarDropdownMenuSoftwares"}).findAll("a", {"class": "dropdown-item"})
+        navbar = doc.find("div", {"aria-labelledby": "navbarDropdownMenuSoftwares"})
+        logger.debug("navbar[]='%s'", type(navbar))
+        if navbar is None:
+            logger.warning("Cannot find navigation bar, cannot continue!")
+            return 1
+
+        items = navbar.findAll("a", {"class": "dropdown-item"})
         logger.debug("items[]='%s'", type(items))
 
         logger.info("Checking %d menu items ...", len(items))