prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  No Bing results for Searx (but for SearxNG)
  The public instances Searx instances don't seem return any results for Bing but SearxNG instances do. I think the situation has been the same for days or even weeks.
  
  I tried out several searx and searxng instances: https://searx.space/
  
  ### Searx
  
  Example Searx instance: https://searx.roflcopter.fr/ (1.1.0-53-c647b55e)
  [Bing search in roflcopter.fr](https://searx.roflcopter.fr/search?q=%21bi%20foo&categories=none&language=en-US) gave "Sorry! we didn't find any results."
  
  ### SearxNG
  
  Example SearxNG instances: https://northboot.xyz/ (2023.2.4+7320b0c7)
  [Bing search in northboot.xyz](https://northboot.xyz/search?q=%21bi+foo&category_general=1&language=en-US&time_range=&safesearch=1&theme=simple) gave a pageful of results.
  
  ### Suggestion
  
  Might the fix be included in the [SearxNG commit list](https://github.com/searxng/searxng/commits/master/searx/engines/bing.py)? There are several references to Bing that are not included in [Searx commit list](https://github.com/searx/searx/commits/master/searx/engines/bing.py)
  There is a big diff between https://raw.githubusercontent.com/searxng/searxng/master/searx/engines/bing.py and https://raw.githubusercontent.com/searx/searx/master/searx/engines/bing.py
  
  --- 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 """
  3  Bing (Web)
  4 """
  5 
  6 import re
  7 from urllib.parse import urlencode
  8 from lxml import html
  9 from searx import logger
  10 from searx.utils import eval_xpath, extract_text, match_language
  11 
  12 logger = logger.getChild('bing engine')
  13 
  14 # about
  15 about = {
  16     "website": 'https://www.bing.com',
  17     "wikidata_id": 'Q182496',
  18     "official_api_documentation": 'https://www.microsoft.com/en-us/bing/apis/bing-web-search-api',
  19     "use_official_api": False,
  20     "require_api_key": False,
  21     "results": 'HTML',
  22 }
  23 
  24 # engine dependent config
  25 categories = ['general']
  26 paging = True
  27 supported_languages_url = 'https://www.bing.com/account/general'
  28 language_aliases = {'zh-CN': 'zh-CHS', 'zh-TW': 'zh-CHT', 'zh-HK': 'zh-CHT'}
  29 
  30 # search-url
  31 base_url = 'https://www.bing.com/'
  32 search_string = 'search?{query}&first={offset}'
  33 
  34 
  35 def _get_offset_from_pageno(pageno):
  36     return (pageno - 1) * 10 + 1
  37 
  38 
  39 # do search-request
  40 def request(query, params):
  41     offset = _get_offset_from_pageno(params.get('pageno', 0))
  42 
  43     if params['language'] == 'all':
  44         lang = 'EN'
  45     else:
  46         lang = match_language(params['language'], supported_languages, language_aliases)
  47 
  48     query = 'language:{} {}'.format(lang.split('-')[0].upper(), query)
  49 
  50     search_path = search_string.format(
  51         query=urlencode({'q': query}),
  52         offset=offset)
  53 
  54     params['url'] = base_url + search_path
  55     params['headers']['User-Agent'] = ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 '
  56                                        '(KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36')
  57 
  58     return params
  59 
  60 
  61 # get response from search-request
  62 def response(resp):
  63     results = []
  64     result_len = 0
  65 
  66     dom = html.fromstring(resp.text)
  67     # parse results
  68     for result in eval_xpath(dom, '//div[@class="sa_cc"]'):
  69         link = eval_xpath(result, './/h3/a')[0]
  70         url = link.attrib.get('href')
  71         pretty_url = extract_text(eval_xpath(result, './/cite'))
  72         title = extract_text(link)
  73         content = extract_text(eval_xpath(result, './/p'))
  74 
  75         # append result
  76         results.append({'url': url,
  77                         'pretty_url': pretty_url,
  78                         'title': title,
  79                         'content': content})
  80 
  81     # parse results again if nothing is found yet
  82     for result in eval_xpath(dom, '//li[@class="b_algo"]'):
  83         link = eval_xpath(result, './/h2/a')[0]
  84         url = link.attrib.get('href')
  85         title = extract_text(link)
  86         content = extract_text(eval_xpath(result, './/p'))
  87 
  88         # append result
  89         results.append({'url': url,
  90                         'title': title,
  91                         'content': content})
  92 
  93     try:
  94         result_len_container = "".join(eval_xpath(dom, '//span[@class="sb_count"]//text()'))
  95         if "-" in result_len_container:
  96             # Remove the part "from-to" for paginated request ...
  97             result_len_container = result_len_container[result_len_container.find("-") * 2 + 2:]
  98 
  99         result_len_container = re.sub('[^0-9]', '', result_len_container)
  100         if len(result_len_container) > 0:
  101             result_len = int(result_len_container)
  102     except Exception as e:
  103         logger.debug('result error :\n%s', e)
  104 
  105     if result_len and _get_offset_from_pageno(resp.search_params.get("pageno", 0)) > result_len:
  106         return []
  107 
  108     results.append({'number_of_results': result_len})
  109     return results
  110 
  111 
  112 # get supported languages from their site
  113 def _fetch_supported_languages(resp):
  114     lang_tags = set()
  115 
  116     setmkt = re.compile('setmkt=([^&]*)')
  117     dom = html.fromstring(resp.text)
  118     lang_links = eval_xpath(dom, "//li/a[contains(@href, 'setmkt')]")
  119 
  120     for a in lang_links:
  121         href = eval_xpath(a, './@href')[0]
  122         match = setmkt.search(href)
  123         l_tag = match.groups()[0]
  124         _lang, _nation = l_tag.split('-', 1)
  125         l_tag = _lang.lower() + '-' + _nation.upper()
  126         lang_tags.add(l_tag)
  127 
  128     return list(lang_tags)
  129
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/searx/engines/bing.py b/searx/engines/bing.py
  --- a/searx/engines/bing.py
  +++ b/searx/engines/bing.py
  @@ -52,8 +52,7 @@
           offset=offset)
   
       params['url'] = base_url + search_path
  -    params['headers']['User-Agent'] = ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 '
  -                                       '(KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36')
  +    params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
   
       return params
  
verification_info: {"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@@ -52,8 +52,7 @@\n         offset=offset)\n \n     params['url'] = base_url + search_path\n-    params['headers']['User-Agent'] = ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 '\n-                                       '(KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36')\n+    params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'\n \n     return params\n", "issue": "No Bing results for Searx (but for SearxNG)\nThe public instances Searx instances don't seem return any results for Bing but SearxNG instances do. I think the situation has been the same for days or even weeks.\r\n\r\nI tried out several searx and searxng instances: https://searx.space/\r\n\r\n### Searx\r\n\r\nExample Searx instance: https://searx.roflcopter.fr/ (1.1.0-53-c647b55e)\r\n[Bing search in roflcopter.fr](https://searx.roflcopter.fr/search?q=%21bi%20foo&categories=none&language=en-US) gave \"Sorry! we didn't find any results.\"\r\n\r\n### SearxNG\r\n\r\nExample SearxNG instances: https://northboot.xyz/ (2023.2.4+7320b0c7)\r\n[Bing search in northboot.xyz](https://northboot.xyz/search?q=%21bi+foo&category_general=1&language=en-US&time_range=&safesearch=1&theme=simple) gave a pageful of results.\r\n\r\n### Suggestion\r\n\r\nMight the fix be included in the [SearxNG commit list](https://github.com/searxng/searxng/commits/master/searx/engines/bing.py)? There are several references to Bing that are not included in [Searx commit list](https://github.com/searx/searx/commits/master/searx/engines/bing.py)\r\nThere is a big diff between https://raw.githubusercontent.com/searxng/searxng/master/searx/engines/bing.py and https://raw.githubusercontent.com/searx/searx/master/searx/engines/bing.py\n", "before_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n\"\"\"\n Bing (Web)\n\"\"\"\n\nimport re\nfrom urllib.parse import urlencode\nfrom lxml import html\nfrom searx import logger\nfrom searx.utils import eval_xpath, extract_text, match_language\n\nlogger = logger.getChild('bing engine')\n\n# about\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']\npaging = True\nsupported_languages_url = 'https://www.bing.com/account/general'\nlanguage_aliases = {'zh-CN': 'zh-CHS', 'zh-TW': 'zh-CHT', 'zh-HK': 'zh-CHT'}\n\n# search-url\nbase_url = 'https://www.bing.com/'\nsearch_string = 'search?{query}&first={offset}'\n\n\ndef _get_offset_from_pageno(pageno):\n    return (pageno - 1) * 10 + 1\n\n\n# do search-request\ndef request(query, params):\n    offset = _get_offset_from_pageno(params.get('pageno', 0))\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(\n        query=urlencode({'q': query}),\n        offset=offset)\n\n    params['url'] = base_url + search_path\n    params['headers']['User-Agent'] = ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 '\n                                       '(KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36')\n\n    return params\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n    result_len = 0\n\n    dom = html.fromstring(resp.text)\n    # parse results\n    for result in eval_xpath(dom, '//div[@class=\"sa_cc\"]'):\n        link = eval_xpath(result, './/h3/a')[0]\n        url = link.attrib.get('href')\n        pretty_url = extract_text(eval_xpath(result, './/cite'))\n        title = extract_text(link)\n        content = extract_text(eval_xpath(result, './/p'))\n\n        # append result\n        results.append({'url': url,\n                        'pretty_url': pretty_url,\n                        'title': title,\n                        'content': content})\n\n    # parse results again if nothing is found yet\n    for result in eval_xpath(dom, '//li[@class=\"b_algo\"]'):\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        # append result\n        results.append({'url': url,\n                        'title': title,\n                        'content': content})\n\n    try:\n        result_len_container = \"\".join(eval_xpath(dom, '//span[@class=\"sb_count\"]//text()'))\n        if \"-\" in result_len_container:\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        if len(result_len_container) > 0:\n            result_len = int(result_len_container)\n    except Exception as e:\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    lang_tags = set()\n\n    setmkt = re.compile('setmkt=([^&]*)')\n    dom = html.fromstring(resp.text)\n    lang_links = eval_xpath(dom, \"//li/a[contains(@href, 'setmkt')]\")\n\n    for a in lang_links:\n        href = eval_xpath(a, './@href')[0]\n        match = setmkt.search(href)\n        l_tag = match.groups()[0]\n        _lang, _nation = l_tag.split('-', 1)\n        l_tag = _lang.lower() + '-' + _nation.upper()\n        lang_tags.add(l_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\"\"\"\n Bing (Web)\n\"\"\"\n\nimport re\nfrom urllib.parse import urlencode\nfrom lxml import html\nfrom searx import logger\nfrom searx.utils import eval_xpath, extract_text, match_language\n\nlogger = logger.getChild('bing engine')\n\n# about\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']\npaging = True\nsupported_languages_url = 'https://www.bing.com/account/general'\nlanguage_aliases = {'zh-CN': 'zh-CHS', 'zh-TW': 'zh-CHT', 'zh-HK': 'zh-CHT'}\n\n# search-url\nbase_url = 'https://www.bing.com/'\nsearch_string = 'search?{query}&first={offset}'\n\n\ndef _get_offset_from_pageno(pageno):\n    return (pageno - 1) * 10 + 1\n\n\n# do search-request\ndef request(query, params):\n    offset = _get_offset_from_pageno(params.get('pageno', 0))\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(\n        query=urlencode({'q': query}),\n        offset=offset)\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\n    return params\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n    result_len = 0\n\n    dom = html.fromstring(resp.text)\n    # parse results\n    for result in eval_xpath(dom, '//div[@class=\"sa_cc\"]'):\n        link = eval_xpath(result, './/h3/a')[0]\n        url = link.attrib.get('href')\n        pretty_url = extract_text(eval_xpath(result, './/cite'))\n        title = extract_text(link)\n        content = extract_text(eval_xpath(result, './/p'))\n\n        # append result\n        results.append({'url': url,\n                        'pretty_url': pretty_url,\n                        'title': title,\n                        'content': content})\n\n    # parse results again if nothing is found yet\n    for result in eval_xpath(dom, '//li[@class=\"b_algo\"]'):\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        # append result\n        results.append({'url': url,\n                        'title': title,\n                        'content': content})\n\n    try:\n        result_len_container = \"\".join(eval_xpath(dom, '//span[@class=\"sb_count\"]//text()'))\n        if \"-\" in result_len_container:\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        if len(result_len_container) > 0:\n            result_len = int(result_len_container)\n    except Exception as e:\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    lang_tags = set()\n\n    setmkt = re.compile('setmkt=([^&]*)')\n    dom = html.fromstring(resp.text)\n    lang_links = eval_xpath(dom, \"//li/a[contains(@href, 'setmkt')]\")\n\n    for a in lang_links:\n        href = eval_xpath(a, './@href')[0]\n        match = setmkt.search(href)\n        l_tag = match.groups()[0]\n        _lang, _nation = l_tag.split('-', 1)\n        l_tag = _lang.lower() + '-' + _nation.upper()\n        lang_tags.add(l_tag)\n\n    return list(lang_tags)\n", "path": "searx/engines/bing.py"}]}