curl tests: handle edge case where .find('body') returns None

This commit is contained in:
Alexandre Aubin 2024-08-31 18:47:58 +02:00
parent 53998f051d
commit 6e48040cbc

View file

@ -163,7 +163,8 @@ def test(
except Exception:
title = ""
content = html.find("body").get_text().strip()
content = html.find("body")
content = content.get_text().strip() if content else ""
content = re.sub(r"[\t\n\s]{3,}", "\n\n", content)
errors = []