mirror of
https://github.com/searxng/searxng.git
synced 2026-09-23 06:36:12 +00:00
[refactor] engines: migrate to SXNG_Response.html() (#6718)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user