Repository: searxng/searxng

Issue:
Bug: seznam(CZ) ignored in search results
<!-- PLEASE FILL THESE FIELDS, IT REALLY HELPS THE MAINTAINERS OF SearXNG -->

**Versions of SearX(NG):**
2022.11.25-1314c1c5, vanilla
2022.11.27-90b429bb, vanilla
2022.11.28, vanilla
2.3.7+20221122, fork
1.1.0-37-4d9586e2, vanilla

**How did you install SearX(NG)?**
I didn't. I tried several public instances and all suffer from the same issue.

**What happened?**
When searching for some Czech terms, like "seznam.cz", there is never the "seznam(CZ)" tag under individual search results. When trying to limit the search to the seznam(CZ) engine:
`!szn seznam.cz`
I'm getting an error:
`Sorry!we didn't find any results. Please use another query or search in more categories.`
When trying to limit the search to bing using "!bi" keyword, it works as expected (all search results have the bing tag under them).

**How to reproduce:**
`!szn <search term>`

**Expected behavior:**
When limiting searching to the seznam(CZ) engine, all search results should have the "seznam(CZ)" tag under them.
When searching w/o limiting, "seznam(CZ)" tag should be mixed in with other tags among search results.

**Screenshots:**
![searxng error](https://user-images.githubusercontent.com/12926163/204420911-8a7a4ffa-5927-4d13-907d-22ea0fb5bc4f.png)

**Additional context:**
Besides public instances w/ the latest docker image (2022.11.25-1314c1c5). It neither works w/ forks, upstream searX instances nor higher NG versions than those utilizing dockerized images from docker hub.
https://searx.be/
https://searx.tiekoetter.com/
https://searx.mistli.net/
https://search.privacyguides.net/
https://searx.webheberg.info/
https://spot.murena.io/
https://darmarit.org/searx/



Discussion:
@dudik could you have a look / seznam seems to need an update of the XPath selecotors again.
I've noticed something perhaps worth mentioning. While several instances already running the latest 2022.11.29-a8359dd4 suffer from the same issue, there is one sticking out: https://s.frlt.one, which sometimes (not always) shows a different error:
![sagasu error](https://user-images.githubusercontent.com/12926163/204617623-433f4b2c-11ec-409a-a22d-f2feebf798ba.png)

I've checked on searx.space it's reported as "V" - vanilla so how come it behaves differently than the others?
@Venca24 the initial sezname engine is from yours (64df38da56) ... in 35dd069402 @dalf implemented a python module for this engine.

Could you have a look / seznam seems to need an update of the XPath selectors again.

ATM the engine does not work any more .. if we can't fix the engine, we have to drop it.

Thanks for your help :+1:

Resolving patch:
diff --git a/searx/engines/seznam.py b/searx/engines/seznam.py
--- a/searx/engines/seznam.py
+++ b/searx/engines/seznam.py
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: AGPL-3.0-or-later
-"""
- Seznam
+# lint: pylint
+"""Seznam
+
 """
 
 from urllib.parse import urlencode
@@ -11,7 +12,6 @@
     extract_text,
     eval_xpath_list,
     eval_xpath_getindex,
-    eval_xpath,
 )
 
 # about
@@ -54,8 +54,12 @@ def response(resp):
     results = []
 
     dom = html.fromstring(resp.content.decode())
-    for result_element in eval_xpath_list(dom, '//div[@data-dot="results"]/div'):
-        result_data = eval_xpath_getindex(result_element, './/div[contains(@class, "bec586")]', 0, default=None)
+    for result_element in eval_xpath_list(
+        dom, '//div[@id="searchpage-root"]//div[@class="Layout--left"]/div[@class="f2c528"]'
+    ):
+        result_data = eval_xpath_getindex(
+            result_element, './/div[@class="c8774a" or @class="e69e8d a11657"]', 0, default=None
+        )
         if result_data is None:
             continue
         title_element = eval_xpath_getindex(result_element, './/h3/a', 0)
@@ -63,7 +67,7 @@ def response(resp):
             {
                 'url': title_element.get('href'),
                 'title': extract_text(title_element),
-                'content': extract_text(eval_xpath(result_data, './/div[@class="_3eded7"]')),
+                'content': extract_text(result_data),
             }
         )
 


Test patch: