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"])
-
- 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)
-
- if content is None:
- logger.debug("domain='%s' has returned empty header='%s' - SKIPPED!", domain, header)
- continue
- elif not isinstance(content, str):
- logger.debug("content[]='%s' is not supported/wanted type 'str' - SKIPPED!", type(content))
- continue
- elif content.lower() in translations:
- logger.debug("Found header with blocked instances - BREAK!")
- found = header
- break
+ for content in header.find_all(["h2", "h3", "h4", "h5"]):
+ logger.debug("content[%s]='%s' - BEFORE!", type(content), content)
+ if content is not None:
+ content = str(content.contents[0])
+ logger.debug("content[%s]='%s' - AFTER!", type(content), content)
+
+ if content is None:
+ logger.debug("domain='%s' has returned empty header='%s' - SKIPPED!", domain, header)
+ continue
+ elif not isinstance(content, str):
+ logger.debug("content[]='%s' is not supported/wanted type 'str' - SKIPPED!", type(content))
+ continue
+ elif content.lower() in translations:
+ logger.debug("Found header with blocked instances - BREAK!")
+ found = header
+ break
logger.debug("found[]='%s'", type(found))
if found is None: