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) diff --git a/tests/unit/engines/test_deviantart.py b/tests/unit/engines/test_deviantart.py index 78a391334..c00bb8fab 100644 --- a/tests/unit/engines/test_deviantart.py +++ b/tests/unit/engines/test_deviantart.py @@ -28,44 +28,13 @@ class TestDeviantartEngine(SearxTestCase): self.assertEqual(deviantart.response(response), []) html = """ -