mirror of
https://github.com/searxng/searxng.git
synced 2026-06-22 01:28:31 +02:00
Compare commits
2 Commits
ab81c77533
...
b48205b384
| Author | SHA1 | Date | |
|---|---|---|---|
| b48205b384 | |||
| 8522638b00 |
@@ -140,7 +140,9 @@ def response(resp: "SXNG_Response"):
|
|||||||
if "u" not in result:
|
if "u" not in result:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
res.add(res.types.MainResult(url=result["u"], title=result["t"], content=html_to_text(result["a"])))
|
res.add(
|
||||||
|
res.types.MainResult(url=result["u"], title=html_to_text(result["t"]), content=html_to_text(result["a"]))
|
||||||
|
)
|
||||||
|
|
||||||
# link to next page
|
# link to next page
|
||||||
next_page_path = res_json["results"][-1].get("n")
|
next_page_path = res_json["results"][-1].get("n")
|
||||||
|
|||||||
@@ -134,9 +134,12 @@ def response(resp: "SXNG_Response") -> EngineResults:
|
|||||||
|
|
||||||
if tiger_category == "Websuche":
|
if tiger_category == "Websuche":
|
||||||
for result in eval_xpath_list(doc, "//div[@id='mainContainer']//table/tr"):
|
for result in eval_xpath_list(doc, "//div[@id='mainContainer']//table/tr"):
|
||||||
|
url = extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]/@href"))
|
||||||
|
if not url:
|
||||||
|
continue
|
||||||
res.add(
|
res.add(
|
||||||
res.types.MainResult(
|
res.types.MainResult(
|
||||||
url=extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]/@href")),
|
url=url,
|
||||||
title=extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]")) or "",
|
title=extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]")) or "",
|
||||||
content=extract_text(eval_xpath(result, ".//*[contains(@class, 'webbodynopic')]")) or "",
|
content=extract_text(eval_xpath(result, ".//*[contains(@class, 'webbodynopic')]")) or "",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user