diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2017-01-04 19:09:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-04 19:09:12 +0100 |
| commit | 627962ce40cd66d84f1be2d88907496fbd40b902 (patch) | |
| tree | 06e28dbd41e5386063a399c0f3a11b9dede2bd28 /searx/engines | |
| parent | 84a2c97a653d216690da0000f47582118709d2d7 (diff) | |
| parent | 025ce5a1d9b4e5e17e8753f90ac0a3258890bf29 (diff) | |
Merge branch 'master' into flask_perimeter
Diffstat (limited to 'searx/engines')
| -rw-r--r-- | searx/engines/xpath.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index e5c0c5bea..18943bba4 100644 --- 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): |