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/gigablast.py | |
| parent | 52450fd08a3c70f6cc0ef806fc450f70dc867d49 (diff) | |
| parent | 1bb46e5e377dee6a742b1d03876aa188d237bcb2 (diff) | |
Merge branch 'master' of https://github.com/asciimoo/searx into boilerplate
Diffstat (limited to 'searx/engines/gigablast.py')
| -rw-r--r-- | searx/engines/gigablast.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index 6b0402233..a84f3f69d 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -15,6 +15,7 @@ from json import loads from time import time from lxml.html import fromstring from searx.url_utils import urlencode +from searx.utils import eval_xpath # engine dependent config categories = ['general'] @@ -99,9 +100,9 @@ def response(resp): def _fetch_supported_languages(resp): supported_languages = [] dom = fromstring(resp.text) - links = dom.xpath('//span[@id="menu2"]/a') + links = eval_xpath(dom, '//span[@id="menu2"]/a') for link in links: - href = link.xpath('./@href')[0].split('lang%3A') + href = eval_xpath(link, './@href')[0].split('lang%3A') if len(href) == 2: code = href[1].split('_') if len(code) == 2: |