From 6e48040cbc72c4ac8797c22eb2aae547b235ae70 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 31 Aug 2024 18:47:58 +0200 Subject: [PATCH] curl tests: handle edge case where .find('body') returns None --- lib/curl_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/curl_tests.py b/lib/curl_tests.py index 8f7c4e5..f7c70d4 100644 --- a/lib/curl_tests.py +++ b/lib/curl_tests.py @@ -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 = []