浏览代码

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