diff options
author | Bnyro <bnyro@tutanota.com> | 2023-09-30 19:58:39 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2023-10-01 08:19:45 +0200 |
commit | fe9386b58d491ce3ba439d2984d71f45ca8702ed (patch) | |
tree | 17e28f4785efc9597c0a1acc91bcfd04340a61c3 /searx | |
parent | 32a4ea350ee0bbbc1b1a941391626b53e4894920 (diff) | |
download | searxng-fe9386b58d491ce3ba439d2984d71f45ca8702ed.tar.gz searxng-fe9386b58d491ce3ba439d2984d71f45ca8702ed.zip |
[fix] emojipedia: fix engine
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/emojipedia.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/searx/engines/emojipedia.py b/searx/engines/emojipedia.py index 020bf689b..a1f3ef7b8 100644 --- a/searx/engines/emojipedia.py +++ b/searx/engines/emojipedia.py @@ -14,7 +14,6 @@ from lxml import html from searx.utils import ( eval_xpath_list, - eval_xpath_getindex, extract_text, ) @@ -28,11 +27,9 @@ about = { } categories = [] -paging = False -time_range_support = False base_url = 'https://emojipedia.org' -search_url = base_url + '/search/?{query}' +search_url = base_url + '/search?{query}' def request(query, params): @@ -47,20 +44,10 @@ def response(resp): dom = html.fromstring(resp.text) - for result in eval_xpath_list(dom, "//ol[@class='search-results']/li"): + for result in eval_xpath_list(dom, '//div[starts-with(@class, "EmojisList")]/a'): - extracted_desc = extract_text(eval_xpath_getindex(result, './/p', 0)) - - if 'No results found.' in extracted_desc: - break - - link = eval_xpath_getindex(result, './/h2/a', 0) - - url = base_url + link.attrib.get('href') - title = extract_text(link) - content = extracted_desc - - res = {'url': url, 'title': title, 'content': content} + url = base_url + result.attrib.get('href') + res = {'url': url, 'title': extract_text(result), 'content': ''} results.append(res) |