From 7db4558de707d62e85ab8b68fa4198d92cf537d7 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Tue, 18 Feb 2014 16:14:31 +0100 Subject: [PATCH] [mod][fix] startpage engine updates --- searx/engines/startpage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py index cbafe097..f5a65231 100644 --- a/searx/engines/startpage.py +++ b/searx/engines/startpage.py @@ -29,9 +29,12 @@ def response(resp): dom = html.fromstring(resp.content) # ads xpath //div[@id="results"]/div[@id="sponsored"]//div[@class="result"] # not ads: div[@class="result"] are the direct childs of div[@id="results"] - for result in dom.xpath('//div[@id="results"]/div[@class="result"]'): + for result in dom.xpath('//div[@class="result"]'): link = result.xpath('.//h3/a')[0] url = link.attrib.get('href') + if url.startswith('http://www.google.')\ + or url.startswith('https://www.google.'): + continue title = link.text_content() content = ''