diff --git a/searx/engines/bing.py b/searx/engines/bing.py index 61abd466..7d9d8549 100644 --- a/searx/engines/bing.py +++ b/searx/engines/bing.py @@ -68,11 +68,13 @@ def response(resp): for result in eval_xpath(dom, '//div[@class="sa_cc"]'): link = eval_xpath(result, './/h3/a')[0] url = link.attrib.get('href') + pretty_url = extract_text(eval_xpath(result, './/cite')) title = extract_text(link) content = extract_text(eval_xpath(result, './/p')) # append result results.append({'url': url, + 'pretty_url': pretty_url, 'title': title, 'content': content}) diff --git a/searx/webapp.py b/searx/webapp.py index e37eaf73..9f5a004b 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -647,7 +647,7 @@ def search(): # removing html content and whitespace duplications result['title'] = ' '.join(html_to_text(result['title']).strip().split()) - if 'url' in result: + if 'url' in result and !('pretty_url' in result): result['pretty_url'] = prettify_url(result['url']) # TODO, check if timezone is calculated right