mirror of
https://github.com/searxng/searxng.git
synced 2025-07-16 09:49:21 +02:00
Add tests for the Wolfram Alpha engines (both API and NO API versions)
This commit is contained in:
parent
5ed8f4da80
commit
be54e5269a
5 changed files with 539 additions and 8 deletions
|
@ -48,13 +48,16 @@ def response(resp):
|
|||
if search_results.xpath('/queryresult[attribute::success="false"]'):
|
||||
return []
|
||||
|
||||
# parse result
|
||||
result = search_results.xpath('//pod[attribute::primary="true"]/subpod/plaintext')[0].text
|
||||
result = replace_pua_chars(result)
|
||||
# parse answer
|
||||
answer = search_results.xpath('//pod[attribute::primary="true"]/subpod/plaintext')
|
||||
if not answer:
|
||||
return results
|
||||
|
||||
answer = replace_pua_chars(answer[0].text)
|
||||
|
||||
# append result
|
||||
# TODO: shouldn't it bind the source too?
|
||||
results.append({'answer': result})
|
||||
results.append({'answer': answer})
|
||||
|
||||
# return results
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue