We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug: bing sometimes missing first result
**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
Repository: https://github.com/searxng/searxng
Branch: master
Version: 2022.12.30-647a0aa9


**How did you install SearXNG?**
script, also occurs in some public instances
**What happened?**
Bing is sometimes missing the first result.

**How To Reproduce**
`!bi pontiac aztek`

No Wikipedia article returned, 9 results are listed.

`!bi pontiac aztek wiki`

Multiple Wikipedia articles are returned, none of which are the English article for the Pontiac Aztek. (The Simple English and Scots articles appear.) 9 results are listed.

**Expected behavior**
The expected first result is the Wikipedia article for Pontiac Aztek. Bing.com returns 10 results on the first page, so SearXNG should return 10 results on its first page.

**Screenshots & Logs**
![SearXNG search](https://user-images.githubusercontent.com/1284317/210190306-e0f1bc25-9686-4ac4-8b31-8277c92b6d5b.png)
![Bing.com search](https://user-images.githubusercontent.com/1284317/210190309-83427d11-0893-4677-9ffd-93231b3e11a0.png)

**Additional context**
It seems consistent for specific search terms, but it doesn't always happen. My suspicion is that when the first result is fancy, such as a Wikipedia infobox, SearXNG doesn't see it.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `searx/engines/bing.py`
Content:
```
1 # SPDX-License-Identifier: AGPL-3.0-or-later
2 # lint: pylint
3 """Bing (Web)
4 
5 - https://github.com/searx/searx/issues/2019#issuecomment-648227442
6 """
7 
8 import re
9 from urllib.parse import urlencode, urlparse, parse_qs
10 from lxml import html
11 from searx.utils import eval_xpath, extract_text, eval_xpath_list, match_language
12 from searx.network import multi_requests, Request
13 
14 about = {
15     "website": 'https://www.bing.com',
16     "wikidata_id": 'Q182496',
17     "official_api_documentation": 'https://www.microsoft.com/en-us/bing/apis/bing-web-search-api',
18     "use_official_api": False,
19     "require_api_key": False,
20     "results": 'HTML',
21 }
22 
23 # engine dependent config
24 categories = ['general', 'web']
25 paging = True
26 time_range_support = False
27 safesearch = False
28 send_accept_language_header = True
29 supported_languages_url = 'https://www.bing.com/account/general'
30 language_aliases = {}
31 
32 # search-url
33 base_url = 'https://www.bing.com/'
34 
35 # initial query:     https://www.bing.com/search?q=foo&search=&form=QBLH
36 inital_query = 'search?{query}&search=&form=QBLH'
37 
38 # following queries: https://www.bing.com/search?q=foo&search=&first=11&FORM=PERE
39 page_query = 'search?{query}&search=&first={offset}&FORM=PERE'
40 
41 
42 def _get_offset_from_pageno(pageno):
43     return (pageno - 1) * 10 + 1
44 
45 
46 def request(query, params):
47 
48     offset = _get_offset_from_pageno(params.get('pageno', 1))
49 
50     # logger.debug("params['pageno'] --> %s", params.get('pageno'))
51     # logger.debug("          offset --> %s", offset)
52 
53     search_string = page_query
54     if offset == 1:
55         search_string = inital_query
56 
57     if params['language'] == 'all':
58         lang = 'EN'
59     else:
60         lang = match_language(params['language'], supported_languages, language_aliases)
61 
62     query = 'language:{} {}'.format(lang.split('-')[0].upper(), query)
63 
64     search_path = search_string.format(query=urlencode({'q': query}), offset=offset)
65 
66     if offset > 1:
67         referer = base_url + inital_query.format(query=urlencode({'q': query}))
68         params['headers']['Referer'] = referer
69         logger.debug("headers.Referer --> %s", referer)
70 
71     params['url'] = base_url + search_path
72     params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
73     return params
74 
75 
76 def response(resp):
77 
78     results = []
79     result_len = 0
80 
81     dom = html.fromstring(resp.text)
82 
83     # parse results again if nothing is found yet
84 
85     url_to_resolve = []
86     url_to_resolve_index = []
87     for i, result in enumerate(eval_xpath_list(dom, '//li[@class="b_algo"]')):
88 
89         link = eval_xpath(result, './/h2/a')[0]
90         url = link.attrib.get('href')
91         title = extract_text(link)
92         content = extract_text(eval_xpath(result, './/p'))
93 
94         # get the real URL either using the URL shown to user or following the Bing URL
95         if url.startswith('https://www.bing.com/ck/a?'):
96             url_cite = extract_text(eval_xpath(result, './/div[@class="b_attribution"]/cite'))
97             # Bing can shorten the URL either at the end or in the middle of the string
98             if (
99                 url_cite.startswith('https://')
100                 and '…' not in url_cite
101                 and '...' not in url_cite
102                 and '›' not in url_cite
103             ):
104                 # no need for an additional HTTP request
105                 url = url_cite
106             else:
107                 # resolve the URL with an additional HTTP request
108                 url_to_resolve.append(url.replace('&ntb=1', '&ntb=F'))
109                 url_to_resolve_index.append(i)
110                 url = None  # remove the result if the HTTP Bing redirect raise an exception
111 
112         # append result
113         results.append({'url': url, 'title': title, 'content': content})
114 
115     # resolve all Bing redirections in parallel
116     request_list = [
117         Request.get(u, allow_redirects=False, headers=resp.search_params['headers']) for u in url_to_resolve
118     ]
119     response_list = multi_requests(request_list)
120     for i, redirect_response in enumerate(response_list):
121         if not isinstance(redirect_response, Exception):
122             results[url_to_resolve_index[i]]['url'] = redirect_response.headers['location']
123 
124     # get number_of_results
125     try:
126         result_len_container = "".join(eval_xpath(dom, '//span[@class="sb_count"]//text()'))
127         if "-" in result_len_container:
128 
129             # Remove the part "from-to" for paginated request ...
130             result_len_container = result_len_container[result_len_container.find("-") * 2 + 2 :]
131 
132         result_len_container = re.sub('[^0-9]', '', result_len_container)
133 
134         if len(result_len_container) > 0:
135             result_len = int(result_len_container)
136 
137     except Exception as e:  # pylint: disable=broad-except
138         logger.debug('result error :\n%s', e)
139 
140     if result_len and _get_offset_from_pageno(resp.search_params.get("pageno", 0)) > result_len:
141         return []
142 
143     results.append({'number_of_results': result_len})
144     return results
145 
146 
147 # get supported languages from their site
148 def _fetch_supported_languages(resp):
149 
150     lang_tags = set()
151 
152     dom = html.fromstring(resp.text)
153     lang_links = eval_xpath(dom, '//div[@id="language-section"]//li')
154 
155     for _li in lang_links:
156 
157         href = eval_xpath(_li, './/@href')[0]
158         (_scheme, _netloc, _path, _params, query, _fragment) = urlparse(href)
159         query = parse_qs(query, keep_blank_values=True)
160 
161         # fmt: off
162         setlang = query.get('setlang', [None, ])[0]
163         # example: 'mn-Cyrl-MN' --> '['mn', 'Cyrl-MN']
164         lang, nation = (setlang.split('-', maxsplit=1) + [None,])[:2]  # fmt: skip
165         # fmt: on
166 
167         tag = lang + '-' + nation if nation else lang
168         lang_tags.add(tag)
169 
170     return list(lang_tags)
171
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/searx/engines/bing.py b/searx/engines/bing.py
--- a/searx/engines/bing.py
+++ b/searx/engines/bing.py
@@ -4,6 +4,7 @@
 
 - https://github.com/searx/searx/issues/2019#issuecomment-648227442
 """
+# pylint: disable=too-many-branches
 
 import re
 from urllib.parse import urlencode, urlparse, parse_qs
@@ -74,7 +75,6 @@
 
 
 def response(resp):
-
     results = []
     result_len = 0
 
@@ -84,12 +84,20 @@
 
     url_to_resolve = []
     url_to_resolve_index = []
-    for i, result in enumerate(eval_xpath_list(dom, '//li[@class="b_algo"]')):
+    for i, result in enumerate(eval_xpath_list(dom, '//li[contains(@class, "b_algo")]')):
 
         link = eval_xpath(result, './/h2/a')[0]
         url = link.attrib.get('href')
         title = extract_text(link)
-        content = extract_text(eval_xpath(result, './/p'))
+
+        # Make sure that the element is free of <a href> links and <span class='algoSlug_icon'>
+        content = eval_xpath(result, '(.//p)[1]')
+        for p in content:
+            for e in p.xpath('.//a'):
+                e.getparent().remove(e)
+            for e in p.xpath('.//span[@class="algoSlug_icon"]'):
+                e.getparent().remove(e)
+        content = extract_text(content)
 
         # get the real URL either using the URL shown to user or following the Bing URL
         if url.startswith('https://www.bing.com/ck/a?'):

{"golden_diff": "diff --git a/searx/engines/bing.py b/searx/engines/bing.py\n--- a/searx/engines/bing.py\n+++ b/searx/engines/bing.py\n@@ -4,6 +4,7 @@\n \n - https://github.com/searx/searx/issues/2019#issuecomment-648227442\n \"\"\"\n+# pylint: disable=too-many-branches\n \n import re\n from urllib.parse import urlencode, urlparse, parse_qs\n@@ -74,7 +75,6 @@\n \n \n def response(resp):\n-\n     results = []\n     result_len = 0\n \n@@ -84,12 +84,20 @@\n \n     url_to_resolve = []\n     url_to_resolve_index = []\n-    for i, result in enumerate(eval_xpath_list(dom, '//li[@class=\"b_algo\"]')):\n+    for i, result in enumerate(eval_xpath_list(dom, '//li[contains(@class, \"b_algo\")]')):\n \n         link = eval_xpath(result, './/h2/a')[0]\n         url = link.attrib.get('href')\n         title = extract_text(link)\n-        content = extract_text(eval_xpath(result, './/p'))\n+\n+        # Make sure that the element is free of <a href> links and <span class='algoSlug_icon'>\n+        content = eval_xpath(result, '(.//p)[1]')\n+        for p in content:\n+            for e in p.xpath('.//a'):\n+                e.getparent().remove(e)\n+            for e in p.xpath('.//span[@class=\"algoSlug_icon\"]'):\n+                e.getparent().remove(e)\n+        content = extract_text(content)\n \n         # get the real URL either using the URL shown to user or following the Bing URL\n         if url.startswith('https://www.bing.com/ck/a?'):\n", "issue": "Bug: bing sometimes missing first result\n**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**\r\nRepository: https://github.com/searxng/searxng\r\nBranch: master\r\nVersion: 2022.12.30-647a0aa9\r\n\r\n\r\n**How did you install SearXNG?**\r\nscript, also occurs in some public instances\r\n**What happened?**\r\nBing is sometimes missing the first result.\r\n\r\n**How To Reproduce**\r\n`!bi pontiac aztek`\r\n\r\nNo Wikipedia article returned, 9 results are listed.\r\n\r\n`!bi pontiac aztek wiki`\r\n\r\nMultiple Wikipedia articles are returned, none of which are the English article for the Pontiac Aztek. (The Simple English and Scots articles appear.) 9 results are listed.\r\n\r\n**Expected behavior**\r\nThe expected first result is the Wikipedia article for Pontiac Aztek. Bing.com returns 10 results on the first page, so SearXNG should return 10 results on its first page.\r\n\r\n**Screenshots & Logs**\r\n![SearXNG search](https://user-images.githubusercontent.com/1284317/210190306-e0f1bc25-9686-4ac4-8b31-8277c92b6d5b.png)\r\n![Bing.com search](https://user-images.githubusercontent.com/1284317/210190309-83427d11-0893-4677-9ffd-93231b3e11a0.png)\r\n\r\n**Additional context**\r\nIt seems consistent for specific search terms, but it doesn't always happen. My suspicion is that when the first result is fancy, such as a Wikipedia infobox, SearXNG doesn't see it.\n", "before_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"Bing (Web)\n\n- https://github.com/searx/searx/issues/2019#issuecomment-648227442\n\"\"\"\n\nimport re\nfrom urllib.parse import urlencode, urlparse, parse_qs\nfrom lxml import html\nfrom searx.utils import eval_xpath, extract_text, eval_xpath_list, match_language\nfrom searx.network import multi_requests, Request\n\nabout = {\n    \"website\": 'https://www.bing.com',\n    \"wikidata_id\": 'Q182496',\n    \"official_api_documentation\": 'https://www.microsoft.com/en-us/bing/apis/bing-web-search-api',\n    \"use_official_api\": False,\n    \"require_api_key\": False,\n    \"results\": 'HTML',\n}\n\n# engine dependent config\ncategories = ['general', 'web']\npaging = True\ntime_range_support = False\nsafesearch = False\nsend_accept_language_header = True\nsupported_languages_url = 'https://www.bing.com/account/general'\nlanguage_aliases = {}\n\n# search-url\nbase_url = 'https://www.bing.com/'\n\n# initial query:     https://www.bing.com/search?q=foo&search=&form=QBLH\ninital_query = 'search?{query}&search=&form=QBLH'\n\n# following queries: https://www.bing.com/search?q=foo&search=&first=11&FORM=PERE\npage_query = 'search?{query}&search=&first={offset}&FORM=PERE'\n\n\ndef _get_offset_from_pageno(pageno):\n    return (pageno - 1) * 10 + 1\n\n\ndef request(query, params):\n\n    offset = _get_offset_from_pageno(params.get('pageno', 1))\n\n    # logger.debug(\"params['pageno'] --> %s\", params.get('pageno'))\n    # logger.debug(\"          offset --> %s\", offset)\n\n    search_string = page_query\n    if offset == 1:\n        search_string = inital_query\n\n    if params['language'] == 'all':\n        lang = 'EN'\n    else:\n        lang = match_language(params['language'], supported_languages, language_aliases)\n\n    query = 'language:{} {}'.format(lang.split('-')[0].upper(), query)\n\n    search_path = search_string.format(query=urlencode({'q': query}), offset=offset)\n\n    if offset > 1:\n        referer = base_url + inital_query.format(query=urlencode({'q': query}))\n        params['headers']['Referer'] = referer\n        logger.debug(\"headers.Referer --> %s\", referer)\n\n    params['url'] = base_url + search_path\n    params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'\n    return params\n\n\ndef response(resp):\n\n    results = []\n    result_len = 0\n\n    dom = html.fromstring(resp.text)\n\n    # parse results again if nothing is found yet\n\n    url_to_resolve = []\n    url_to_resolve_index = []\n    for i, result in enumerate(eval_xpath_list(dom, '//li[@class=\"b_algo\"]')):\n\n        link = eval_xpath(result, './/h2/a')[0]\n        url = link.attrib.get('href')\n        title = extract_text(link)\n        content = extract_text(eval_xpath(result, './/p'))\n\n        # get the real URL either using the URL shown to user or following the Bing URL\n        if url.startswith('https://www.bing.com/ck/a?'):\n            url_cite = extract_text(eval_xpath(result, './/div[@class=\"b_attribution\"]/cite'))\n            # Bing can shorten the URL either at the end or in the middle of the string\n            if (\n                url_cite.startswith('https://')\n                and '\u2026' not in url_cite\n                and '...' not in url_cite\n                and '\u203a' not in url_cite\n            ):\n                # no need for an additional HTTP request\n                url = url_cite\n            else:\n                # resolve the URL with an additional HTTP request\n                url_to_resolve.append(url.replace('&ntb=1', '&ntb=F'))\n                url_to_resolve_index.append(i)\n                url = None  # remove the result if the HTTP Bing redirect raise an exception\n\n        # append result\n        results.append({'url': url, 'title': title, 'content': content})\n\n    # resolve all Bing redirections in parallel\n    request_list = [\n        Request.get(u, allow_redirects=False, headers=resp.search_params['headers']) for u in url_to_resolve\n    ]\n    response_list = multi_requests(request_list)\n    for i, redirect_response in enumerate(response_list):\n        if not isinstance(redirect_response, Exception):\n            results[url_to_resolve_index[i]]['url'] = redirect_response.headers['location']\n\n    # get number_of_results\n    try:\n        result_len_container = \"\".join(eval_xpath(dom, '//span[@class=\"sb_count\"]//text()'))\n        if \"-\" in result_len_container:\n\n            # Remove the part \"from-to\" for paginated request ...\n            result_len_container = result_len_container[result_len_container.find(\"-\") * 2 + 2 :]\n\n        result_len_container = re.sub('[^0-9]', '', result_len_container)\n\n        if len(result_len_container) > 0:\n            result_len = int(result_len_container)\n\n    except Exception as e:  # pylint: disable=broad-except\n        logger.debug('result error :\\n%s', e)\n\n    if result_len and _get_offset_from_pageno(resp.search_params.get(\"pageno\", 0)) > result_len:\n        return []\n\n    results.append({'number_of_results': result_len})\n    return results\n\n\n# get supported languages from their site\ndef _fetch_supported_languages(resp):\n\n    lang_tags = set()\n\n    dom = html.fromstring(resp.text)\n    lang_links = eval_xpath(dom, '//div[@id=\"language-section\"]//li')\n\n    for _li in lang_links:\n\n        href = eval_xpath(_li, './/@href')[0]\n        (_scheme, _netloc, _path, _params, query, _fragment) = urlparse(href)\n        query = parse_qs(query, keep_blank_values=True)\n\n        # fmt: off\n        setlang = query.get('setlang', [None, ])[0]\n        # example: 'mn-Cyrl-MN' --> '['mn', 'Cyrl-MN']\n        lang, nation = (setlang.split('-', maxsplit=1) + [None,])[:2]  # fmt: skip\n        # fmt: on\n\n        tag = lang + '-' + nation if nation else lang\n        lang_tags.add(tag)\n\n    return list(lang_tags)\n", "path": "searx/engines/bing.py"}], "after_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"Bing (Web)\n\n- https://github.com/searx/searx/issues/2019#issuecomment-648227442\n\"\"\"\n# pylint: disable=too-many-branches\n\nimport re\nfrom urllib.parse import urlencode, urlparse, parse_qs\nfrom lxml import html\nfrom searx.utils import eval_xpath, extract_text, eval_xpath_list, match_language\nfrom searx.network import multi_requests, Request\n\nabout = {\n    \"website\": 'https://www.bing.com',\n    \"wikidata_id\": 'Q182496',\n    \"official_api_documentation\": 'https://www.microsoft.com/en-us/bing/apis/bing-web-search-api',\n    \"use_official_api\": False,\n    \"require_api_key\": False,\n    \"results\": 'HTML',\n}\n\n# engine dependent config\ncategories = ['general', 'web']\npaging = True\ntime_range_support = False\nsafesearch = False\nsend_accept_language_header = True\nsupported_languages_url = 'https://www.bing.com/account/general'\nlanguage_aliases = {}\n\n# search-url\nbase_url = 'https://www.bing.com/'\n\n# initial query:     https://www.bing.com/search?q=foo&search=&form=QBLH\ninital_query = 'search?{query}&search=&form=QBLH'\n\n# following queries: https://www.bing.com/search?q=foo&search=&first=11&FORM=PERE\npage_query = 'search?{query}&search=&first={offset}&FORM=PERE'\n\n\ndef _get_offset_from_pageno(pageno):\n    return (pageno - 1) * 10 + 1\n\n\ndef request(query, params):\n\n    offset = _get_offset_from_pageno(params.get('pageno', 1))\n\n    # logger.debug(\"params['pageno'] --> %s\", params.get('pageno'))\n    # logger.debug(\"          offset --> %s\", offset)\n\n    search_string = page_query\n    if offset == 1:\n        search_string = inital_query\n\n    if params['language'] == 'all':\n        lang = 'EN'\n    else:\n        lang = match_language(params['language'], supported_languages, language_aliases)\n\n    query = 'language:{} {}'.format(lang.split('-')[0].upper(), query)\n\n    search_path = search_string.format(query=urlencode({'q': query}), offset=offset)\n\n    if offset > 1:\n        referer = base_url + inital_query.format(query=urlencode({'q': query}))\n        params['headers']['Referer'] = referer\n        logger.debug(\"headers.Referer --> %s\", referer)\n\n    params['url'] = base_url + search_path\n    params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'\n    return params\n\n\ndef response(resp):\n    results = []\n    result_len = 0\n\n    dom = html.fromstring(resp.text)\n\n    # parse results again if nothing is found yet\n\n    url_to_resolve = []\n    url_to_resolve_index = []\n    for i, result in enumerate(eval_xpath_list(dom, '//li[contains(@class, \"b_algo\")]')):\n\n        link = eval_xpath(result, './/h2/a')[0]\n        url = link.attrib.get('href')\n        title = extract_text(link)\n\n        # Make sure that the element is free of <a href> links and <span class='algoSlug_icon'>\n        content = eval_xpath(result, '(.//p)[1]')\n        for p in content:\n            for e in p.xpath('.//a'):\n                e.getparent().remove(e)\n            for e in p.xpath('.//span[@class=\"algoSlug_icon\"]'):\n                e.getparent().remove(e)\n        content = extract_text(content)\n\n        # get the real URL either using the URL shown to user or following the Bing URL\n        if url.startswith('https://www.bing.com/ck/a?'):\n            url_cite = extract_text(eval_xpath(result, './/div[@class=\"b_attribution\"]/cite'))\n            # Bing can shorten the URL either at the end or in the middle of the string\n            if (\n                url_cite.startswith('https://')\n                and '\u2026' not in url_cite\n                and '...' not in url_cite\n                and '\u203a' not in url_cite\n            ):\n                # no need for an additional HTTP request\n                url = url_cite\n            else:\n                # resolve the URL with an additional HTTP request\n                url_to_resolve.append(url.replace('&ntb=1', '&ntb=F'))\n                url_to_resolve_index.append(i)\n                url = None  # remove the result if the HTTP Bing redirect raise an exception\n\n        # append result\n        results.append({'url': url, 'title': title, 'content': content})\n\n    # resolve all Bing redirections in parallel\n    request_list = [\n        Request.get(u, allow_redirects=False, headers=resp.search_params['headers']) for u in url_to_resolve\n    ]\n    response_list = multi_requests(request_list)\n    for i, redirect_response in enumerate(response_list):\n        if not isinstance(redirect_response, Exception):\n            results[url_to_resolve_index[i]]['url'] = redirect_response.headers['location']\n\n    # get number_of_results\n    try:\n        result_len_container = \"\".join(eval_xpath(dom, '//span[@class=\"sb_count\"]//text()'))\n        if \"-\" in result_len_container:\n\n            # Remove the part \"from-to\" for paginated request ...\n            result_len_container = result_len_container[result_len_container.find(\"-\") * 2 + 2 :]\n\n        result_len_container = re.sub('[^0-9]', '', result_len_container)\n\n        if len(result_len_container) > 0:\n            result_len = int(result_len_container)\n\n    except Exception as e:  # pylint: disable=broad-except\n        logger.debug('result error :\\n%s', e)\n\n    if result_len and _get_offset_from_pageno(resp.search_params.get(\"pageno\", 0)) > result_len:\n        return []\n\n    results.append({'number_of_results': result_len})\n    return results\n\n\n# get supported languages from their site\ndef _fetch_supported_languages(resp):\n\n    lang_tags = set()\n\n    dom = html.fromstring(resp.text)\n    lang_links = eval_xpath(dom, '//div[@id=\"language-section\"]//li')\n\n    for _li in lang_links:\n\n        href = eval_xpath(_li, './/@href')[0]\n        (_scheme, _netloc, _path, _params, query, _fragment) = urlparse(href)\n        query = parse_qs(query, keep_blank_values=True)\n\n        # fmt: off\n        setlang = query.get('setlang', [None, ])[0]\n        # example: 'mn-Cyrl-MN' --> '['mn', 'Cyrl-MN']\n        lang, nation = (setlang.split('-', maxsplit=1) + [None,])[:2]  # fmt: skip\n        # fmt: on\n\n        tag = lang + '-' + nation if nation else lang\n        lang_tags.add(tag)\n\n    return list(lang_tags)\n", "path": "searx/engines/bing.py"}]}