浏览代码

[fix] don't merge with suggestions

potato 8 年前
父节点
当前提交
b808a2e266
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3
    2
      searx/engines/dictionary.py

+ 3
- 2
searx/engines/dictionary.py 查看文件

@@ -1,4 +1,5 @@
1 1
 import re
2
+from urlparse import urljoin
2 3
 from lxml import html
3 4
 from searx.engines.xpath import extract_text
4 5
 from searx.languages import language_codes
@@ -44,7 +45,7 @@ def response(resp):
44 45
 
45 46
     dom = html.fromstring(resp.text)
46 47
 
47
-    for result in dom.xpath(results_xpath)[1:]:
48
+    for k, result in enumerate(dom.xpath(results_xpath)[1:]):
48 49
         try:
49 50
             from_result, to_results_raw = result.xpath('./td')
50 51
         except:
@@ -57,7 +58,7 @@ def response(resp):
57 58
                 to_results.append(to_result.text_content())
58 59
 
59 60
         results.append({
60
-            'url': resp.url,
61
+            'url': urljoin(resp.url, '?%d' % k),
61 62
             'title': from_result.text_content(),
62 63
             'content': '; '.join(to_results)
63 64
         })