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))