summaryrefslogtreecommitdiff
path: root/searx/engines/startpage.py
diff options
context:
space:
mode:
authorAlexandre FLAMENT <alexandre.flament@hesge.ch>2022-10-14 18:27:53 +0000
committerAlexandre FLAMENT <alexandre.flament@hesge.ch>2022-10-14 18:27:53 +0000
commit035bc507ec1b8812f064bb2896138e489ebd6054 (patch)
tree9381727ce092004e6c4afae6320246056ffb3b36 /searx/engines/startpage.py
parent096d9defa6f429244c8a7217282a563f73e29b41 (diff)
downloadsearxng-035bc507ec1b8812f064bb2896138e489ebd6054.tar.gz
searxng-035bc507ec1b8812f064bb2896138e489ebd6054.zip
[fix] startpage engine
Diffstat (limited to 'searx/engines/startpage.py')
-rw-r--r--searx/engines/startpage.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index 087267bb7..24aa59d03 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -89,15 +89,14 @@ def get_sc_code(headers):
dom = html.fromstring(resp.text)
try:
- # href --> '/?sc=adrKJMgF8xwp20'
- href = eval_xpath(dom, '//a[@class="footer-home__logo"]')[0].get('href')
+ # <input type="hidden" name="sc" value="...">
+ sc_code = eval_xpath(dom, '//input[@name="sc"]/@value')[0]
except IndexError as exc:
# suspend startpage API --> https://github.com/searxng/searxng/pull/695
raise SearxEngineResponseException(
suspended_time=7 * 24 * 3600, message="PR-695: query new sc time-stamp failed!"
) from exc
- sc_code = href[5:]
sc_code_ts = time()
logger.debug("new value is: %s", sc_code)