From a68d36c8da3b85089e2011c35a78e5f2d87016f8 Mon Sep 17 00:00:00 2001 From: davidmezzetti <561939+davidmezzetti@users.noreply.github.com> Date: Sat, 28 Dec 2024 11:26:59 -0500 Subject: [PATCH] Handle case when title not present, closes #56 --- src/python/paperetl/file/tei.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python/paperetl/file/tei.py b/src/python/paperetl/file/tei.py index 7d77947..7315afd 100644 --- a/src/python/paperetl/file/tei.py +++ b/src/python/paperetl/file/tei.py @@ -34,7 +34,8 @@ def parse(stream, source): soup = BeautifulSoup(stream, "lxml") - title = soup.title.text + title = soup.find("title") + title = title.text if title and title.text else None # Extract article metadata (