logo

searx

Unnamed repository; edit this file 'description' to name the repository.
commit: 525e5d275c195d26cb9302ceb03f46ffffa6e730
parent: 3d8c9bab9618b4d0cceadfac888af4560f7d3c9b
Author: Adam Tauber <asciimoo@gmail.com>
Date:   Mon,  2 Jan 2017 12:36:50 +0100

Merge pull request #801 from dalf/extract_text

[fix] extract_text: use html.tostring instead html_to_text.

Diffstat:

searx/engines/xpath.py | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py @@ -42,7 +42,9 @@ def extract_text(xpath_results): return ''.join(xpath_results) else: # it's a element - return html_to_text(xpath_results.text_content()).strip() + text = html.tostring(xpath_results, encoding='unicode', method='text', with_tail=False) + text = text.strip().replace('\n', ' ') + return ' '.join(text.split()) def extract_url(xpath_results, search_url):