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