[refactor] engines: migrate to SXNG_Response.html() (#6718)

This commit is contained in:
Bnyro
2026-09-13 14:01:58 +02:00
parent 3169aafd28
commit 274b63b677
75 changed files with 102 additions and 178 deletions

View File

@@ -98,7 +98,6 @@ from unicodedata import combining, normalize
import babel.localedata
import dateutil.parser
import lxml.html
from searx.enginelib import EngineCache
from searx.enginelib.traits import EngineTraits
@@ -257,7 +256,7 @@ def get_sc_code(params):
message="get_sc_code: got redirected to https://www.startpage.com/sp/captcha",
)
dom = lxml.html.fromstring(resp.text)
dom = resp.html()
try:
sc_code = eval_xpath(dom, search_form_xpath + '//input[@name="sc"]/@value')[0]
@@ -503,7 +502,7 @@ def fetch_traits(engine_traits: EngineTraits):
if not resp.ok:
raise RuntimeError("Response from Startpage is not OK.")
dom = lxml.html.fromstring(resp.text)
dom = resp.html()
# regions