diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 05f197422..35b1f4bcb 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -288,7 +288,7 @@ class BGExtract(RegistryProperties): except UnicodeDecodeError: page_source = str(page_source, 'cp1251') try: - soup = BeautifulSoup(page_source) + soup = BeautifulSoup(page_source, 'lxml') except Exception: log.error('BeautifulSoup could not parse the Bible page.') send_error_message('parse') @@ -759,7 +759,7 @@ def get_soup_for_bible_ref(reference_url, header=None, pre_parse_regex=None, pre page_source = re.sub(pre_parse_regex, pre_parse_substitute, page_source.decode()) soup = None try: - soup = BeautifulSoup(page_source) + soup = BeautifulSoup(page_source, 'lxml') CLEANER_REGEX.sub('', str(soup)) except Exception: log.exception('BeautifulSoup could not parse the bible page.') diff --git a/tests/functional/openlp_plugins/bibles/test_http.py b/tests/functional/openlp_plugins/bibles/test_http.py index 0d6684437..54289a163 100644 --- a/tests/functional/openlp_plugins/bibles/test_http.py +++ b/tests/functional/openlp_plugins/bibles/test_http.py @@ -152,7 +152,7 @@ class TestBSExtract(TestCase): self.test_html = '' - self.test_soup = BeautifulSoup(self.test_html) + self.test_soup = BeautifulSoup(self.test_html, 'lxml') instance = BSExtract() self.mock_log.reset_mock() self.mock_urllib.reset_mock()