summaryrefslogtreecommitdiff
path: root/searx/engines/yahoo.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-06-28 00:06:50 +0200
committerAdam Tauber <asciimoo@gmail.com>2016-06-28 00:06:50 +0200
commit2f7752b410c449aac463c248c0b7e41f69b6b07b (patch)
treecf39c310166874a1b3c8fb28a3e925e969794429 /searx/engines/yahoo.py
parent36c8977390b50259de56cc9678499340c78ee25b (diff)
[enh] display number of results
Diffstat (limited to 'searx/engines/yahoo.py')
-rw-r--r--searx/engines/yahoo.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.py
index 769e7e47f..b8b40e4aa 100644
--- a/searx/engines/yahoo.py
+++ b/searx/engines/yahoo.py
@@ -77,6 +77,13 @@ def response(resp):
dom = html.fromstring(resp.text)
+ try:
+ results_num = int(dom.xpath('//div[@class="compPagination"]/span[last()]/text()')[0]
+ .split()[0].replace(',', ''))
+ results.append({'number_of_results': results_num})
+ except:
+ pass
+
# parse results
for result in dom.xpath(results_xpath):
try: