From 7de506bbcd054d3c83c909fd85746cdc8fd86588 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Thu, 30 Jan 2014 01:55:49 +0100 Subject: [PATCH] [enh] paging support for stackoverflow --- searx/engines/stackoverflow.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/searx/engines/stackoverflow.py b/searx/engines/stackoverflow.py index 35230600f..213597243 100644 --- a/searx/engines/stackoverflow.py +++ b/searx/engines/stackoverflow.py @@ -6,12 +6,15 @@ from urllib import urlencode categories = ['it'] url = 'http://stackoverflow.com/' -search_url = url+'search?' +search_url = url+'search?{query}&page={pageno}' result_xpath = './/div[@class="excerpt"]//text()' +paging = True + def request(query, params): - params['url'] = search_url + urlencode({'q': query}) + params['url'] = search_url.format(query=urlencode({'q': query}), + pageno=params['pageno']) return params