summaryrefslogtreecommitdiff
path: root/searx/engines/deviantart.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-20 02:31:20 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-20 02:31:20 +0100
commitb2492c94f422e18cb8954ec983134f4fa5c7cdc0 (patch)
tree969ea30e5dc642d896fa7b744571110ebfe13e7a /searx/engines/deviantart.py
parent692c0bf5f0b353bfbb46aaee1af54afb164dedbc (diff)
downloadsearxng-b2492c94f422e18cb8954ec983134f4fa5c7cdc0.tar.gz
searxng-b2492c94f422e18cb8954ec983134f4fa5c7cdc0.zip
[fix] pep/flake8 compatibility
Diffstat (limited to 'searx/engines/deviantart.py')
-rw-r--r--searx/engines/deviantart.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index 9a4a8abde..94a94bf16 100644
--- a/searx/engines/deviantart.py
+++ b/searx/engines/deviantart.py
@@ -7,6 +7,7 @@ categories = ['images']
base_url = 'https://www.deviantart.com/'
search_url = base_url+'search?'
+
def request(query, params):
global search_url
params['url'] = search_url + urlencode({'q': query})
@@ -22,8 +23,11 @@ def response(resp):
for result in dom.xpath('//div[contains(@class, "tt-a tt-fh")]'):
link = result.xpath('.//a[contains(@class, "thumb")]')[0]
url = urljoin(base_url, link.attrib.get('href'))
- title_links = result.xpath('.//span[@class="details"]//a[contains(@class, "t")]')
+ title_links = result.xpath('.//span[@class="details"]//a[contains(@class, "t")]') # noqa
title = ''.join(title_links[0].xpath('.//text()'))
img_src = link.xpath('.//img')[0].attrib['src']
- results.append({'url': url, 'title': title, 'img_src': img_src, 'template': 'images.html'})
+ results.append({'url': url,
+ 'title': title,
+ 'img_src': img_src,
+ 'template': 'images.html'})
return results