@@ -8,6 +8,7 @@ search_url = None
88url_xpath = None
99content_xpath = None
1010title_xpath = None
11+suggestion_xpath = ''
1112results_xpath = ''
1213
1314def extract_url(xpath_results):
@@ -56,5 +57,8 @@ def response(resp):
5657 for content, url, title in zip(dom.xpath(content_xpath), map(extract_url, dom.xpath(url_xpath)), dom.xpath(title_xpath)):
5758 results.append({'url': url, 'title': title, 'content': content})
5859
59−
60+ if not suggestion_xpath:
61+ return results
62+ for suggestion in dom.xpath(suggestion_xpath):
63+ results.append({'suggestion': escape(''.join(suggestion.xpath('.//text()')))})
6064 return results