summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
authorMarc Abonce Seguin <marc-abonce@mailbox.org>2019-01-06 21:31:45 -0600
committerMarc Abonce Seguin <marc-abonce@mailbox.org>2019-01-06 21:31:45 -0600
commit0169b63e849d45b8d68e08dd324726cc61be5e46 (patch)
tree23d33fa17b961322d2b97d167e7d732875b36795 /searx/engines/google.py
parent51111c2594fc7059df03b7a9d3fcf27c022ba804 (diff)
[fix] fetch google's supported languages
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index 49d7f6499..7a4390fc6 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -381,10 +381,10 @@ def attributes_to_html(attributes):
def _fetch_supported_languages(resp):
supported_languages = {}
dom = html.fromstring(resp.text)
- options = dom.xpath('//table//td/font/label/span')
+ options = dom.xpath('//*[@id="langSec"]//input[@name="lr"]')
for option in options:
- code = option.xpath('./@id')[0][1:]
- name = option.text.title()
+ code = option.xpath('./@value')[0].split('_')[-1]
+ name = option.xpath('./@data-name')[0].title()
supported_languages[code] = {"name": name}
return supported_languages