mirror of
https://github.com/searx/searx
synced 2025-01-21 05:08:35 +01:00
[fix] don't merge with suggestions
This commit is contained in:
parent
3f4cc2146c
commit
b808a2e266
@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
from urlparse import urljoin
|
||||||
from lxml import html
|
from lxml import html
|
||||||
from searx.engines.xpath import extract_text
|
from searx.engines.xpath import extract_text
|
||||||
from searx.languages import language_codes
|
from searx.languages import language_codes
|
||||||
@ -44,7 +45,7 @@ def response(resp):
|
|||||||
|
|
||||||
dom = html.fromstring(resp.text)
|
dom = html.fromstring(resp.text)
|
||||||
|
|
||||||
for result in dom.xpath(results_xpath)[1:]:
|
for k, result in enumerate(dom.xpath(results_xpath)[1:]):
|
||||||
try:
|
try:
|
||||||
from_result, to_results_raw = result.xpath('./td')
|
from_result, to_results_raw = result.xpath('./td')
|
||||||
except:
|
except:
|
||||||
@ -57,7 +58,7 @@ def response(resp):
|
|||||||
to_results.append(to_result.text_content())
|
to_results.append(to_result.text_content())
|
||||||
|
|
||||||
results.append({
|
results.append({
|
||||||
'url': resp.url,
|
'url': urljoin(resp.url, '?%d' % k),
|
||||||
'title': from_result.text_content(),
|
'title': from_result.text_content(),
|
||||||
'content': '; '.join(to_results)
|
'content': '; '.join(to_results)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user