diff options
author | Adam Tauber <asciimoo@gmail.com> | 2016-04-07 08:04:36 +0200 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2016-04-07 08:07:17 +0200 |
commit | 9331fc28a8ac2f898a437d126ee59353f7f1bfde (patch) | |
tree | e4f095ac53cce20275b519824bc49b65726bc04d /searx/engines/google_images.py | |
parent | 5cbe4c53329a1fd2b949660fda25ff7a4ce6f254 (diff) | |
download | searxng-9331fc28a8ac2f898a437d126ee59353f7f1bfde.tar.gz searxng-9331fc28a8ac2f898a437d126ee59353f7f1bfde.zip |
[fix] broken google images parsing
Diffstat (limited to 'searx/engines/google_images.py')
-rw-r--r-- | searx/engines/google_images.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py index 9d51428cc..efe46812a 100644 --- a/searx/engines/google_images.py +++ b/searx/engines/google_images.py @@ -49,8 +49,6 @@ def response(resp): # parse results for result in dom.xpath('//div[@data-ved]'): - data_url = result.xpath('./a/@href')[0] - data_query = {k: v[0] for k, v in parse_qs(data_url.split('?', 1)[1]).iteritems()} metadata = loads(result.xpath('./div[@class="rg_meta"]/text()')[0]) @@ -60,11 +58,11 @@ def response(resp): thumbnail_src = thumbnail_src.replace("http://", "https://") # append result - results.append({'url': data_query['imgrefurl'], + results.append({'url': metadata['ru'], 'title': metadata['pt'], 'content': metadata['s'], - 'thumbnail_src': metadata['tu'], - 'img_src': data_query['imgurl'], + 'thumbnail_src': thumbnail_src, + 'img_src': metadata['ou'], 'template': 'images.html'}) # return results |