summaryrefslogtreecommitdiff
path: root/searx/engines/xpath.py
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-25 20:04:44 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-25 20:04:44 +0100
commit44c9216c497862293318a48ad5c39f373cee95e6 (patch)
treecbd6d639cb4f8c7f209e4c05da0e8dda0d0e74cf /searx/engines/xpath.py
parent516ea9b76901532337d1171c6c72bb98dc6d4431 (diff)
Sanitize extract_text
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):