From 0d4da30c7f9104224ec96d7adf61747fb761b52b Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Thu, 5 Jan 2017 17:20:12 +0100 Subject: [PATCH] [enh] add instant answers to google engine --- searx/engines/google.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/searx/engines/google.py b/searx/engines/google.py index 803cd307e..2fa638d73 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -217,6 +217,10 @@ def response(resp): # convert the text to dom dom = html.fromstring(resp.text) + instant_answer = dom.xpath('//div[@id="_vBb"]//text()') + if instant_answer: + results.append({'answer': u' '.join(instant_answer)}) + # parse results for result in dom.xpath(results_xpath): try: