summaryrefslogtreecommitdiff
path: root/searx/engines/wolframalpha_api.py
diff options
context:
space:
mode:
authora01200356 <a01200356@itesm.mx>2016-01-02 22:29:20 -0600
committera01200356 <a01200356@itesm.mx>2016-01-02 22:29:20 -0600
commitd05c676ed5b1dc5372b1cb380740161b3613f7cc (patch)
tree570970099a74220e81217c37df929835b2703ddd /searx/engines/wolframalpha_api.py
parent19d025f0e7ef9a5f41b81fc6c1a9a7114bdae78c (diff)
downloadsearxng-d05c676ed5b1dc5372b1cb380740161b3613f7cc.tar.gz
searxng-d05c676ed5b1dc5372b1cb380740161b3613f7cc.zip
Add test case in wolframalpha_noapi
[fix] Display multiple answers in wolframalpha_api
Diffstat (limited to 'searx/engines/wolframalpha_api.py')
-rw-r--r--searx/engines/wolframalpha_api.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py
index d4127be4c..540d81351 100644
--- a/searx/engines/wolframalpha_api.py
+++ b/searx/engines/wolframalpha_api.py
@@ -52,12 +52,13 @@ def response(resp):
if search_results.xpath(failure_xpath):
return []
- # parse answer
- answer = search_results.xpath(answer_xpath)
- if answer:
- answer = replace_pua_chars(answer[0].text)
+ # parse answers
+ answers = search_results.xpath(answer_xpath)
+ if answers:
+ for answer in answers:
+ answer = replace_pua_chars(answer.text)
- results.append({'answer': answer})
+ results.append({'answer': answer})
# TODO: append a result with title and link, like in the no api version