searxng/searx
Markus Heiser 540323a4b0 [mod] hardening xpath engine: ignore empty results
A SearXNG maintainer on Matrix reported a traceback::

    File "searxng-src/searx/engines/xpath.py", line 272, in response
      dom = html.fromstring(resp.text)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "searx-pyenv/lib/python3.11/site-packages/lxml/html/__init__.py", line 850, in fromstring
      doc = document_fromstring(html, parser=parser, base_url=base_url, **kw)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "searx-pyenv/lib/python3.11/site-packages/lxml/html/__init__.py", line 738, in document_fromstring
      raise etree.ParserError(
    lxml.etree.ParserError: Document is empty

I don't have an example to reproduce the issue, but the issue and this patch are
clearly recognizable even without an example.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-11-29 14:20:31 +01:00
..
answerers [fix] setup.py - packaging for 'answerers' to build a valid package 2024-06-17 15:07:07 +02:00
botdetection [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
data [data] update searx.data - update_wikidata_units.py 2024-11-29 08:01:13 +01:00
enginelib [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
engines [mod] hardening xpath engine: ignore empty results 2024-11-29 14:20:31 +01:00
favicons [fix] favicons: msgspec.ValidationError: Expected Path, got str - at $.favicons.cache.db_url 2024-10-29 18:22:22 +01:00
infopage [mod] add French translation for infopage 2024-08-20 07:25:39 +02:00
metrics [fix] openmetrics: value is None if there's no data 2024-11-25 16:57:03 +01:00
network [log] warning with URL in case of 'raise_for_httperror' 2024-11-23 11:33:19 +01:00
plugins [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
search [log] warning with URL in case of 'raise_for_httperror' 2024-11-23 11:33:19 +01:00
static [build] /static 2024-11-25 09:34:02 +01:00
templates/simple [mod] add CSS (LESS) to xsl style to view rss in browser 2024-11-25 09:34:02 +01:00
translations [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
__init__.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
autocomplete.py [fix] html.unescape stract autocomplete suggestions 2024-07-02 18:16:46 +02:00
babel_extract.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
compat.py [mod] Revision of the favicon solution 2024-10-05 08:18:28 +02:00
exceptions.py [fix] engine: duckduckgo - CAPTCHA detection 2024-10-19 14:55:44 +02:00
external_bang.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
external_urls.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
flaskfix.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
limiter.py [fix] limiter: don't hard code settings folder to /etc/searxng 2024-10-28 12:51:05 +01:00
limiter.toml [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
locales.py [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
openmetrics.py [fix] openmetrics: value is None if there's no data 2024-11-25 16:57:03 +01:00
preferences.py [fix] remove unknown_params from preferences 2024-11-24 19:55:21 +01:00
query.py [refactor] unit tests to utilize paramaterized and break down monolithic tests 2024-10-03 13:20:32 +02:00
redisdb.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
redislib.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
results.py [fix] search: titles including html brackets are not shown properly 2024-08-31 17:11:49 +02:00
searxng.msg [feat] simple theme: pure black theme style 2024-10-03 10:53:17 +02:00
settings.yml [fix] crowdview engine: html tags in title and content 2024-11-28 06:19:55 +01:00
settings_defaults.py [feat] metrics: support for open metrics 2024-11-24 14:25:49 +01:00
settings_loader.py [mod] revision of the settings_loader 2024-07-14 18:10:06 +02:00
sqlitedb.py [mod] sqlitedb: access to SQLite databases a little more convenient. 2024-10-05 08:18:28 +02:00
sxng_locales.py [data] update searx.data - update_engine_traits.py 2024-10-15 06:37:01 +02:00
unixthreadname.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
utils.py [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
version.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
webadapter.py [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
webapp.py [mod] add CSS (LESS) to xsl style to view rss in browser 2024-11-25 09:34:02 +01:00
webutils.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00