wikipedia engine: update _fetch_supported_languages

the layout https://meta.wikimedia.org/wiki/List_of_Wikipedias has changed
This commit is contained in:
Alexandre Flament 2023-01-29 10:01:02 +00:00
parent 8256de2fe8
commit bfca63c536

View file

@ -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}