@@ -8,6 +8,7 @@ search_url = None
8url_xpath = None
8url_xpath = None
9content_xpath = None
9content_xpath = None
10title_xpath = None
10title_xpath = None
11results_xpath = ''
12results_xpath = ''
13def extract_url(xpath_results):
14def extract_url(xpath_results):
@@ -56,5 +57,8 @@ def response(resp):
56 for content, url, title in zip(dom.xpath(content_xpath), map(extract_url, dom.xpath(url_xpath)), dom.xpath(title_xpath)):
57 for content, url, title in zip(dom.xpath(content_xpath), map(extract_url, dom.xpath(url_xpath)), dom.xpath(title_xpath)):
57 results.append({'url': url, 'title': title, 'content': content})
58 results.append({'url': url, 'title': title, 'content': content})
59−
60+ if not suggestion_xpath:
62+ for suggestion in dom.xpath(suggestion_xpath):
63+ results.append({'suggestion': escape(''.join(suggestion.xpath('.//text()')))})
60 return results
64 return results