@@ -32,8 +32,9 @@ search_url = base_url + 'do/search'
32# specific xpath variables
32# specific xpath variables
33# ads xpath //div[@id="results"]/div[@id="sponsored"]//div[@class="result"]
33# ads xpath //div[@id="results"]/div[@id="sponsored"]//div[@class="result"]
34# not ads: div[@class="result"] are the direct childs of div[@id="results"]
34# not ads: div[@class="result"] are the direct childs of div[@id="results"]
35−results_xpath = '//div[@class="result"]'
35+results_xpath = '//li[contains(@class, "search-result") and contains(@class, "search-item")]'
36link_xpath = './/h3/a'
36link_xpath = './/h3/a'
37+content_xpath = './p[@class="search-item__body"]'
39# do search-request
40# do search-request
@@ -79,8 +80,8 @@ def response(resp):
80 title = extract_text(link)
81 title = extract_text(link)
82− if result.xpath('./p[@class="desc clk"]'):
83+ if result.xpath(content_xpath):
83− content = extract_text(result.xpath('./p[@class="desc clk"]'))
84+ content = extract_text(result.xpath(content_xpath))
85 content = ''
86 content = ''