From bfca63c5365aa77cea34b70cbf929d7b6d0a789d Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Sun, 29 Jan 2023 10:01:02 +0000 Subject: [PATCH] wikipedia engine: update _fetch_supported_languages the layout https://meta.wikimedia.org/wiki/List_of_Wikipedias has changed --- searx/engines/wikipedia.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py index 52b1053ed..ca841e8b3 100644 --- a/searx/engines/wikipedia.py +++ b/searx/engines/wikipedia.py @@ -106,9 +106,9 @@ def _fetch_supported_languages(resp): for tr in trs: td = tr.xpath('./td') code = td[3].xpath('./a')[0].text - name = td[2].xpath('./a')[0].text + name = td[1].xpath('./a')[0].text english_name = td[1].xpath('./a')[0].text - articles = int(td[4].xpath('./a/b')[0].text.replace(',', '')) + articles = int(td[4].xpath('./a')[0].text.replace(',', '')) # exclude languages with too few articles if articles >= 100: supported_languages[code] = {"name": name, "english_name": english_name}