From: Oleg Broytman Date: Sun, 11 Aug 2024 18:24:52 +0000 (+0300) Subject: Fix(bkmk_ph_lxml): Catch `ParserError` X-Git-Tag: 5.6.1~1 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=423f1fa6637b96ddff4c6ecc3a11fc039c46733d;p=bookmarks_db.git Fix(bkmk_ph_lxml): Catch `ParserError` --- diff --git a/parse_html/bkmk_ph_lxml.py b/parse_html/bkmk_ph_lxml.py index 7af98e7..eb8ecc6 100644 --- a/parse_html/bkmk_ph_lxml.py +++ b/parse_html/bkmk_ph_lxml.py @@ -12,6 +12,7 @@ __all__ = ['parse_html'] import re +from lxml.etree import ParserError from lxml.html import fromstring from .bkmk_ph_util import HTMLParser @@ -39,6 +40,8 @@ def parse_html(html_text, charset=None, log=None): return None else: raise + except ParserError: + return None title = html_tree.findtext('head/title') if title is None: