summaryrefslogtreecommitdiff
path: root/searx/engines/xpath.py
diff options
context:
space:
mode:
authorAdam Tauber <adam.tauber@balabit.com>2015-02-02 09:37:12 +0100
committerAdam Tauber <adam.tauber@balabit.com>2015-02-02 09:37:12 +0100
commit0e6f8393ab8b29b2e85d1fafdc7442455767f753 (patch)
tree60e9acb27577968a41136c04f248c24871e83860 /searx/engines/xpath.py
parent03137eebd9fdfaa57452cb364c1bc9f31b243f67 (diff)
parent7f865356f9a6c1b40d0c668c59b3d081de618bac (diff)
Merge branch 'Cqoicebordel-unit-tests'
Diffstat (limited to 'searx/engines/xpath.py')
-rw-r--r--searx/engines/xpath.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
index 72120304e..1a599dc0a 100644
--- a/searx/engines/xpath.py
+++ b/searx/engines/xpath.py
@@ -28,13 +28,13 @@ def extract_text(xpath_results):
result = ''
for e in xpath_results:
result = result + extract_text(e)
- return result
+ return result.strip()
elif type(xpath_results) in [_ElementStringResult, _ElementUnicodeResult]:
# it's a string
return ''.join(xpath_results)
else:
# it's a element
- return html_to_text(xpath_results.text_content())
+ return html_to_text(xpath_results.text_content()).strip()
def extract_url(xpath_results, search_url):