mirror of
https://github.com/searxng/searxng.git
synced 2024-11-26 12:51:02 +00:00
[fix] engine google: strip bubble text from answers
Google underlines words inside of answers that can be clicked to show additional definitions. These definitions inside the answer were not correctly handled and ended up in the middle of the answer text. With this fix, the extra definitions are stripped from the answer shown by the frontend.
This commit is contained in:
parent
e76a4f72ef
commit
7f9ce3b96e
1 changed files with 2 additions and 0 deletions
|
@ -334,6 +334,8 @@ def response(resp):
|
||||||
# results --> answer
|
# results --> answer
|
||||||
answer_list = eval_xpath(dom, '//div[contains(@class, "LGOjhe")]')
|
answer_list = eval_xpath(dom, '//div[contains(@class, "LGOjhe")]')
|
||||||
for item in answer_list:
|
for item in answer_list:
|
||||||
|
for bubble in eval_xpath(item, './/div[@class="nnFGuf"]'):
|
||||||
|
bubble.drop_tree()
|
||||||
results.append(
|
results.append(
|
||||||
{
|
{
|
||||||
'answer': item.xpath("normalize-space()"),
|
'answer': item.xpath("normalize-space()"),
|
||||||
|
|
Loading…
Reference in a new issue