diff options
author | Adam Tauber <asciimoo@gmail.com> | 2016-01-23 15:20:36 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2016-01-23 15:20:36 +0100 |
commit | e061c6e059ab8055f5b95f162d791fa9c9c422d6 (patch) | |
tree | 13f445411fefd7071997dda24839eb030ef55256 /searx/engines/yandex.py | |
parent | c61ea820d2db9bebe82c8e442b0d3558d014e2cc (diff) | |
download | searxng-e061c6e059ab8055f5b95f162d791fa9c9c422d6.tar.gz searxng-e061c6e059ab8055f5b95f162d791fa9c9c422d6.zip |
[fix] swisscow and yandex escaping - fixes #499
Diffstat (limited to 'searx/engines/yandex.py')
-rw-r--r-- | searx/engines/yandex.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/engines/yandex.py b/searx/engines/yandex.py index 938fdd184..be3ec36ce 100644 --- a/searx/engines/yandex.py +++ b/searx/engines/yandex.py @@ -9,6 +9,7 @@ @parse url, title, content """ +from cgi import escape from urllib import urlencode from lxml import html from searx.search import logger @@ -51,8 +52,8 @@ def response(resp): for result in dom.xpath(results_xpath): try: res = {'url': result.xpath(url_xpath)[0], - 'title': ''.join(result.xpath(title_xpath)), - 'content': ''.join(result.xpath(content_xpath))} + 'title': escape(''.join(result.xpath(title_xpath))), + 'content': escape(''.join(result.xpath(content_xpath)))} except: logger.exception('yandex parse crash') continue |