diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2019-12-03 11:38:52 +0100 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarit.de> | 2019-12-03 11:38:52 +0100 |
| commit | 1b90e1403ba832672d8bde02e15a20834ee02e0e (patch) | |
| tree | 09545a498e3fe172cf51cc85ba7c4afe8fba9a3c /searx/engines/startpage.py | |
| parent | 52450fd08a3c70f6cc0ef806fc450f70dc867d49 (diff) | |
| parent | 1bb46e5e377dee6a742b1d03876aa188d237bcb2 (diff) | |
Merge branch 'master' of https://github.com/asciimoo/searx into boilerplate
Diffstat (limited to 'searx/engines/startpage.py')
| -rw-r--r-- | searx/engines/startpage.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py index 0f0ec6e18..76567396f 100644 --- a/searx/engines/startpage.py +++ b/searx/engines/startpage.py @@ -16,6 +16,7 @@ from datetime import datetime, timedelta import re from searx.engines.xpath import extract_text from searx.languages import language_codes +from searx.utils import eval_xpath # engine dependent config categories = ['general'] @@ -70,8 +71,8 @@ def response(resp): dom = html.fromstring(resp.text) # parse results - for result in dom.xpath(results_xpath): - links = result.xpath(link_xpath) + for result in eval_xpath(dom, results_xpath): + links = eval_xpath(result, link_xpath) if not links: continue link = links[0] @@ -87,8 +88,8 @@ def response(resp): title = extract_text(link) - if result.xpath(content_xpath): - content = extract_text(result.xpath(content_xpath)) + if eval_xpath(result, content_xpath): + content = extract_text(eval_xpath(result, content_xpath)) else: content = '' |