mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 12:10:00 +00:00
[enh] initial commit
This commit is contained in:
14
searx/engines/duckduckgo.py
Normal file
14
searx/engines/duckduckgo.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from lxml import html
|
||||
|
||||
|
||||
def request(query, params):
|
||||
params['method'] = 'POST'
|
||||
params['url'] = 'https://duckduckgo.com/html'
|
||||
params['data']['q'] = query
|
||||
return params
|
||||
|
||||
|
||||
def response(resp):
|
||||
dom = html.fromstring(resp.text)
|
||||
results = dom.xpath('//div[@class="results_links results_links_deep web-result"]')
|
||||
return [html.tostring(x) for x in results]
|
||||
Reference in New Issue
Block a user