@@ -1,6 +1,7 @@
11from urllib import quote
22from lxml import html
33from urlparse import urljoin
4+from cgi import escape
45
56base_url = 'http://stackoverflow.com/'
67search_url = base_url+'search?q='
@@ -20,6 +21,6 @@ def response(resp):
2021 link = result.xpath('.//div[@class="result-link"]//a')[0]
2122 url = urljoin(base_url, link.attrib.get('href'))
2223 title = ' '.join(link.xpath('.//text()'))
23− content = ' '.join(result.xpath('.//div[@class="excerpt"]//text()'))
24+ content = escape(' '.join(result.xpath('.//div[@class="excerpt"]//text()')))
2425 results.append({'url': url, 'title': title, 'content': content})
2526 return results