1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-20 03:10:10 +01:00

[enh] paging support for stackoverflow

This commit is contained in:
asciimoo 2014-01-30 01:55:49 +01:00
parent 6cbf9bf67d
commit 7de506bbcd

View File

@ -6,12 +6,15 @@ from urllib import urlencode
categories = ['it'] categories = ['it']
url = 'http://stackoverflow.com/' url = 'http://stackoverflow.com/'
search_url = url+'search?' search_url = url+'search?{query}&page={pageno}'
result_xpath = './/div[@class="excerpt"]//text()' result_xpath = './/div[@class="excerpt"]//text()'
paging = True
def request(query, params): 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 return params