From 0169b63e849d45b8d68e08dd324726cc61be5e46 Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Sun, 6 Jan 2019 21:31:45 -0600 Subject: [fix] fetch google's supported languages --- searx/engines/google.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'searx/engines/google.py') 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 -- cgit v1.2.3