From 8918b4106aa33d936f07df41ac0bdc65825e6ef4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 28 Jul 2022 11:12:38 -0700 Subject: html ingest: handle TEI-XML parse error --- python/sandcrawler/ingest_file.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/sandcrawler/ingest_file.py b/python/sandcrawler/ingest_file.py index 3102ec2..6c72b96 100644 --- a/python/sandcrawler/ingest_file.py +++ b/python/sandcrawler/ingest_file.py @@ -457,7 +457,10 @@ class IngestFileWorker(SandcrawlerWorker): return dict(status="html-selectolax-error") html_biblio = html_extract_biblio(resource.terminal_url, html_doc) assert html_biblio - html_body = html_extract_body_teixml(resource.body) + try: + html_body = html_extract_body_teixml(resource.body) + except xml.etree.ElementTree.ParseError: + return dict(status="html-teixml-error") html_platform = html_guess_platform(resource.terminal_url, html_doc, html_biblio) html_scope = html_guess_scope( resource.terminal_url, html_doc, html_biblio, html_body.get("word_count") -- cgit v1.2.3