@@ -11,6 +11,14 @@ title_xpath = None
1111suggestion_xpath = ''
1212results_xpath = ''
1313
14+# parameters for engines with paging support
15+#
16+# number of results on each page
17+# (only needed if the site requires not a page number, but an offset)
18+page_size = 1
19+# number of the first page (usually 0 or 1)
20+first_page_num = 1
21+
1422
1523'''
1624if xpath_results is list, extract the text from each result and concat the list
@@ -76,8 +84,14 @@ def normalize_url(url):
7684
7785def request(query, params):
7886 query = urlencode({'q': query})[2:]
79− params['url'] = search_url.format(query=query)
87+
88+ fp = {'query': query}
89+ if paging and search_url.find('{pageno}') >= 0:
90+ fp['pageno'] = (params['pageno'] + first_page_num - 1) * page_size
91+
92+ params['url'] = search_url.format(**fp)
8093 params['query'] = query
94+
8195 return params
8296
8397