# replaced find_next_siblings with find_all_next to account for instances that e.g. hide lists in dropdown menu
for line in header.find_all_next("table")[0].find_all("tr")[1:]:
domain = line.find("span").text
- digest = line.find("span")["title"][9:]
reason = line.find_all("td")[1].text
logger.debug("domain='%s',reason='%s' - BEFORE!", domain, reason)
domain = tidyup.domain(domain) if domain != "" else None
reason = tidyup.reason(reason) if reason != "" else None
-
logger.debug("domain='%s',reason='%s' - AFTER!", domain, reason)
+
+ digest = line.find("span")["title"][9:]
+
+ logger.debug("digest='%s' - BEFORE!", digest)
+ if not validators.hashes.sha256(digest):
+ logger.warning("domain='%s' has invalid digest='%s' - Setting to None ...", domain, digest)
+ digest = None
+ logger.debug("digest='%s' - AFTER!", digest)
+
+ logger.debug("domain[]='%s'", type(domain))
if domain in [None, ""]:
logger.warning("domain='%s' is empty,line='%s' - SKIPPED!", domain, line)
continue
elif block_level in ["accept", "accepted"]:
logger.debug("block[domain]='%s' has unwanted severity level '%s' - SKIPPED!", block["domain"], block_level)
continue
- elif "digest" in block and not validators.hashes.sha256(block["digest"]):
+ elif "digest" in block and not block["digest"] is None and not validators.hashes.sha256(block["digest"]):
logger.warning("block[domain]='%s' has invalid block[digest]='%s' - SKIPPED!", block["domain"], block["digest"])
continue