diff options
author | pw3t <romain@berthor.fr> | 2014-01-19 21:20:07 +0100 |
---|---|---|
committer | pw3t <romain@berthor.fr> | 2014-01-19 21:20:07 +0100 |
commit | 1dd35e9916dabd5426f92e5e0921148b439bb376 (patch) | |
tree | 4a85ec7853535fe72898641fe248506266a9477e /searx/engines/startpage.py | |
parent | d6b017efb5b51623a02c85690c7335cfc6674092 (diff) | |
download | searxng-1dd35e9916dabd5426f92e5e0921148b439bb376.tar.gz searxng-1dd35e9916dabd5426f92e5e0921148b439bb376.zip |
[ehn] added ixquick engine, using startpage engine
Diffstat (limited to 'searx/engines/startpage.py')
-rw-r--r-- | searx/engines/startpage.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py index 87c091e2d..f1ff76292 100644 --- a/searx/engines/startpage.py +++ b/searx/engines/startpage.py @@ -3,8 +3,8 @@ from lxml import html from urlparse import urlparse from cgi import escape -base_url = 'https://startpage.com/' -search_url = base_url+'do/search' +base_url = None +search_url = None def request(query, params): global search_url @@ -26,6 +26,11 @@ def response(resp): url = link.attrib.get('href') parsed_url = urlparse(url) title = link.text_content() - content = result.xpath('./p[@class="desc"]')[0].text_content() + + content ='' + if len(result.xpath('./p[@class="desc"]')): + content = result.xpath('./p[@class="desc"]')[0].text_content() + results.append({'url': url, 'title': title, 'content': content}) + return results |