[fix] swisscow and yandex escaping - fixes #499

This commit is contained in:
Adam Tauber 2016-01-23 15:20:36 +01:00
parent c61ea820d2
commit e061c6e059
2 changed files with 8 additions and 6 deletions

View file

@ -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