From: Roland Häder Date: Wed, 19 Jul 2023 11:05:14 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6041a75bcc5eb81f9a69281ee733a6a5d23072dc;p=fba.git Continued: - in case of database error (on their side), there is no navigation which lead here to a method invocation findAll() on NoneType --- diff --git a/fba/commands.py b/fba/commands.py index ae92ef6..76525c3 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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))