summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorNoemi Vanyi <sitbackandwait@gmail.com>2016-07-19 09:37:02 +0200
committerNoemi Vanyi <sitbackandwait@gmail.com>2016-07-19 09:37:02 +0200
commitba590de7f1506b8b8e281403dc47b6dcdbe3ead1 (patch)
tree0170416cae30d4910516c5c3a3af37ce830b0d9b /searx
parentaa09f963eb8220f866334779f61741da8926fcf2 (diff)
[fix] deviantart engine xpaths
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/deviantart.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index c7816b9bc..70761370c 100644
--- a/searx/engines/deviantart.py
+++ b/searx/engines/deviantart.py
@@ -50,11 +50,10 @@ def response(resp):
regex = re.compile(r'\/200H\/')
# parse results
- 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 = extract_text(title_links[0])
+ for result in dom.xpath('.//span[@class="thumb wide"]'):
+ link = result.xpath('.//a[@class="torpedo-thumb-link"]')[0]
+ url = link.attrib.get('href')
+ title = extract_text(result.xpath('.//span[@class="title"]'))
thumbnail_src = link.xpath('.//img')[0].attrib.get('src')
img_src = regex.sub('/', thumbnail_src)