@@ -107,13 +107,12 @@ images_path = '/images'
107supported_languages_url = 'https://www.google.com/preferences?#languages'
107supported_languages_url = 'https://www.google.com/preferences?#languages'
109# specific xpath variables
109# specific xpath variables
110−results_xpath = '//div[@class="g"]'
110+results_xpath = '//div[contains(@class, "ZINbbc")]'
111−url_xpath = './/h3/a/@href'
111+url_xpath = './/div[@class="kCrYT"][1]/a/@href'
112−title_xpath = './/h3'
112+title_xpath = './/div[@class="kCrYT"][1]/a/div[1]'
113−content_xpath = './/span[@class="st"]'
113+content_xpath = './/div[@class="kCrYT"][2]//div[contains(@class, "BNeawe")]//div[contains(@class, "BNeawe")]'
114−content_misc_xpath = './/div[@class="f slp"]'
115−suggestion_xpath = '//p[@class="_Bmc"]'
114+suggestion_xpath = '//div[contains(@class, "ZINbbc")][last()]//div[@class="rVLSBd"]/a//div[contains(@class, "BNeawe")]'
116−spelling_suggestion_xpath = '//a[@class="spell"]'
115+spelling_suggestion_xpath = '//div[@id="scc"]//a'
118# map : detail location
117# map : detail location
119map_address_xpath = './/div[@class="s"]//table//td[2]/span/text()'
118map_address_xpath = './/div[@class="s"]//table//td[2]/span/text()'
@@ -199,10 +198,6 @@ def request(query, params):
199 params['headers']['Accept-Language'] = language + ',' + language + '-' + country
198 params['headers']['Accept-Language'] = language + ',' + language + '-' + country
200 params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
199 params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
202− # Force Safari 3.1 on Mac OS X (Leopard) user agent to avoid loading the new UI that Searx can't parse
203− params['headers']['User-Agent'] = ("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4)"
204− "AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1")
206 params['google_hostname'] = google_hostname
201 params['google_hostname'] = google_hostname
208 return params
203 return params
@@ -274,9 +269,7 @@ def response(resp):
274 content = extract_text_from_dom(result, content_xpath)
269 content = extract_text_from_dom(result, content_xpath)
275 if content is None:
270 if content is None:
277− content_misc = extract_text_from_dom(result, content_misc_xpath)
272+
278− if content_misc is not None:
279− content = content_misc + "<br />" + content
280 # append result
273 # append result
281 results.append({'url': url,
274 results.append({'url': url,
282 'title': title,
275 'title': title,