summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index e82260356..dbca205a1 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -90,7 +90,7 @@ url_map = 'https://www.openstreetmap.org/'\
search_path = '/search'
search_url = ('https://{hostname}' +
search_path +
- '?{query}&start={offset}&gbv=1&gws_rd=cr')
+ '?{query}&start={offset}&gbv=1&gws_rd=ssl')
# other URLs
map_hostname_start = 'maps.google.'
@@ -99,7 +99,7 @@ redirect_path = '/url'
images_path = '/images'
# specific xpath variables
-results_xpath = '//li[@class="g"]'
+results_xpath = '//div[@class="g"]'
url_xpath = './/h3/a/@href'
title_xpath = './/h3'
content_xpath = './/span[@class="st"]'
@@ -209,29 +209,29 @@ def response(resp):
parsed_url = urlparse(url, google_hostname)
# map result
- if ((parsed_url.netloc == google_hostname and parsed_url.path.startswith(maps_path))
- or (parsed_url.netloc.startswith(map_hostname_start))):
- x = result.xpath(map_near)
- if len(x) > 0:
- # map : near the location
- results = results + parse_map_near(parsed_url, x, google_hostname)
- else:
- # map : detail about a location
- results = results + parse_map_detail(parsed_url, result, google_hostname)
-
- # google news
- elif (parsed_url.netloc == google_hostname
- and parsed_url.path == search_path):
- # skipping news results
- pass
-
- # images result
- elif (parsed_url.netloc == google_hostname
- and parsed_url.path == images_path):
- # only thumbnail image provided,
- # so skipping image results
- # results = results + parse_images(result, google_hostname)
- pass
+ if parsed_url.netloc == google_hostname:
+ # TODO fix inside links
+ continue
+ # if parsed_url.path.startswith(maps_path) or parsed_url.netloc.startswith(map_hostname_start):
+ # print "yooooo"*30
+ # x = result.xpath(map_near)
+ # if len(x) > 0:
+ # # map : near the location
+ # results = results + parse_map_near(parsed_url, x, google_hostname)
+ # else:
+ # # map : detail about a location
+ # results = results + parse_map_detail(parsed_url, result, google_hostname)
+ # # google news
+ # elif parsed_url.path == search_path:
+ # # skipping news results
+ # pass
+
+ # # images result
+ # elif parsed_url.path == images_path:
+ # # only thumbnail image provided,
+ # # so skipping image results
+ # # results = results + parse_images(result, google_hostname)
+ # pass
else:
# normal result