mirror of https://github.com/searxng/searxng.git
[fix] pep8
This commit is contained in:
parent
99688d2c8e
commit
85b81be35b
|
@ -4,6 +4,7 @@ from lxml import html
|
||||||
base_url = None
|
base_url = None
|
||||||
search_url = None
|
search_url = None
|
||||||
|
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
global search_url
|
global search_url
|
||||||
query = urlencode({'q': query})[2:]
|
query = urlencode({'q': query})[2:]
|
||||||
|
@ -24,10 +25,10 @@ def response(resp):
|
||||||
url = link.attrib.get('href')
|
url = link.attrib.get('href')
|
||||||
title = link.text_content()
|
title = link.text_content()
|
||||||
|
|
||||||
content =''
|
content = ''
|
||||||
if len(result.xpath('./p[@class="desc"]')):
|
if len(result.xpath('./p[@class="desc"]')):
|
||||||
content = result.xpath('./p[@class="desc"]')[0].text_content()
|
content = result.xpath('./p[@class="desc"]')[0].text_content()
|
||||||
|
|
||||||
results.append({'url': url, 'title': title, 'content': content})
|
results.append({'url': url, 'title': title, 'content': content})
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in New Issue