mirror of
https://github.com/searxng/searxng.git
synced 2026-06-22 01:28:31 +02:00
[feat] engines: add support for search.ch/web (Swiss)
This commit is contained in:
@@ -292,7 +292,7 @@ def response(resp) -> EngineResults: # pylint: disable=too-many-branches
|
|||||||
|
|
||||||
if results_xpath:
|
if results_xpath:
|
||||||
for result in eval_xpath_list(dom, results_xpath):
|
for result in eval_xpath_list(dom, results_xpath):
|
||||||
url = extract_url(eval_xpath_list(result, url_xpath, min_len=1), search_url)
|
url = extract_url(eval_xpath(result, url_xpath), search_url)
|
||||||
title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
|
title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
|
||||||
content = extract_text(eval_xpath_list(result, content_xpath))
|
content = extract_text(eval_xpath_list(result, content_xpath))
|
||||||
tmp_result = {'url': url, 'title': title, 'content': content}
|
tmp_result = {'url': url, 'title': title, 'content': content}
|
||||||
|
|||||||
@@ -2836,6 +2836,25 @@ engines:
|
|||||||
shortcut: rehi
|
shortcut: rehi
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|
||||||
|
- name: searchch
|
||||||
|
engine: xpath
|
||||||
|
shortcut: sch
|
||||||
|
paging: true
|
||||||
|
search_url: https://search.ch/web/api/loadmore.html?path=/web/&q={query}&page={pageno}
|
||||||
|
results_xpath: //div[contains(@class, 'www-feed-web-result')]
|
||||||
|
# the URL looks like "//search.ch/web/r/redirect?...result!uffe8997e781e241d/https://example.com"
|
||||||
|
url_xpath: concat('https://', substring-after(.//a[contains(@class, 'sl-gus-result-url')]/@href, '://'))
|
||||||
|
title_xpath: .//a[contains(@class, 'sl-gus-result-title')]
|
||||||
|
content_xpath: .//div[contains(@class, 'sl-gus-result-body')]
|
||||||
|
language: "ch"
|
||||||
|
disabled: true
|
||||||
|
about:
|
||||||
|
website: https://search.ch/web
|
||||||
|
description: "Swiss search engine with its own Swiss index"
|
||||||
|
use_official_api: false
|
||||||
|
require_api_key: false
|
||||||
|
results: HTML
|
||||||
|
|
||||||
- name: searchzee
|
- name: searchzee
|
||||||
engine: json_engine
|
engine: json_engine
|
||||||
search_url: https://searchzee.com/api/search?q={query}&type=web&offset={pageno}
|
search_url: https://searchzee.com/api/search?q={query}&type=web&offset={pageno}
|
||||||
|
|||||||
Reference in New Issue
Block a user