From ba590de7f1506b8b8e281403dc47b6dcdbe3ead1 Mon Sep 17 00:00:00 2001 From: Noemi Vanyi Date: Tue, 19 Jul 2016 09:37:02 +0200 Subject: [fix] deviantart engine xpaths --- searx/engines/deviantart.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'searx/engines/deviantart.py') 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) -- cgit v1.2.3