Explorar el Código

[fix] don't merge with suggestions

potato hace 8 años
padre
commit
b808a2e266
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3
    2
      searx/engines/dictionary.py

+ 3
- 2
searx/engines/dictionary.py Ver fichero

@@ -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
         })