diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2019-12-02 13:39:58 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-02 13:39:58 +0000 |
| commit | 731e34299d128f9352fd76e603c960c1f0628ed9 (patch) | |
| tree | f591dc036131f2c3a045fbc557f66afc905646cb /searx/engines/dictzone.py | |
| parent | 574cb25a16c3011f1797115cb6c90117e9bd1e8e (diff) | |
| parent | 85b37233458c21b775bf98568c0a5c9260aa14fe (diff) | |
Merge pull request #1744 from dalf/optimizations
[mod] speed optimization
Diffstat (limited to 'searx/engines/dictzone.py')
| -rw-r--r-- | searx/engines/dictzone.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/engines/dictzone.py b/searx/engines/dictzone.py index 09db048cc..423af0971 100644 --- a/searx/engines/dictzone.py +++ b/searx/engines/dictzone.py @@ -11,7 +11,7 @@ import re from lxml import html -from searx.utils import is_valid_lang +from searx.utils import is_valid_lang, eval_xpath from searx.url_utils import urljoin categories = ['general'] @@ -47,14 +47,14 @@ def response(resp): dom = html.fromstring(resp.text) - for k, result in enumerate(dom.xpath(results_xpath)[1:]): + for k, result in enumerate(eval_xpath(dom, results_xpath)[1:]): try: - from_result, to_results_raw = result.xpath('./td') + from_result, to_results_raw = eval_xpath(result, './td') except: continue to_results = [] - for to_result in to_results_raw.xpath('./p/a'): + for to_result in eval_xpath(to_results_raw, './p/a'): t = to_result.text_content() if t.strip(): to_results.append(to_result.text_content()) |