SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[enh] suggestion support for xpath engine
asciimooe50a72b0e34a
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.pyindex 2743dc2a0..068f2ba61 100644--- a/searx/engines/xpath.py+++ b/searx/engines/xpath.py@@ -8,6 +8,7 @@ search_url = Noneurl_xpath = Nonecontent_xpath = Nonetitle_xpath = None+suggestion_xpath = ''results_xpath = ''def extract_url(xpath_results):@@ -56,5 +57,8 @@ def response(resp):for content, url, title in zip(dom.xpath(content_xpath), map(extract_url, dom.xpath(url_xpath)), dom.xpath(title_xpath)):results.append({'url': url, 'title': title, 'content': content})-+ if not suggestion_xpath:+ return results+ for suggestion in dom.xpath(suggestion_xpath):+ results.append({'suggestion': escape(''.join(suggestion.xpath('.//text()')))})return results