|
|
|
|
5
|
url = 'https://duckduckgo.com/html?{query}&s={offset}'
|
5
|
url = 'https://duckduckgo.com/html?{query}&s={offset}'
|
6
|
locale = 'us-en'
|
6
|
locale = 'us-en'
|
7
|
|
7
|
|
|
|
8
|
+
|
8
|
def request(query, params):
|
9
|
def request(query, params):
|
9
|
offset = (params['pageno'] - 1) * 30
|
10
|
offset = (params['pageno'] - 1) * 30
|
10
|
q = urlencode({'q': query,
|
11
|
q = urlencode({'q': query,
|
|
|
|
|
14
|
|
15
|
|
15
|
|
16
|
|
16
|
def response(resp):
|
17
|
def response(resp):
|
17
|
- result_xpath = '//div[@class="results_links results_links_deep web-result"]'
|
|
|
|
|
18
|
+ result_xpath = '//div[@class="results_links results_links_deep web-result"]' # noqa
|
18
|
url_xpath = './/a[@class="large"]/@href'
|
19
|
url_xpath = './/a[@class="large"]/@href'
|
19
|
title_xpath = './/a[@class="large"]//text()'
|
20
|
title_xpath = './/a[@class="large"]//text()'
|
20
|
content_xpath = './/div[@class="snippet"]//text()'
|
21
|
content_xpath = './/div[@class="snippet"]//text()'
|