Loading searx/engines/startpage.py +20 −12 Original line number Diff line number Diff line ## Startpage (Web) # Startpage (Web) # # @website https://startpage.com # @provide-api no (nothing found) Loading @@ -17,7 +17,10 @@ import re # engine dependent config categories = ['general'] # there is a mechanism to block "bot" search (probably the parameter qid), require storing of qid's between mulitble search-calls # there is a mechanism to block "bot" search # (probably the parameter qid), require # storing of qid's between mulitble search-calls # paging = False language_support = True Loading @@ -44,7 +47,8 @@ def request(query, params): # set language if specified if params['language'] != 'all': params['data']['with_language'] = 'lang_' + params['language'].split('_')[0] params['data']['with_language'] = ('lang_' + params['language'].split('_')[0]) return params Loading @@ -57,7 +61,10 @@ def response(resp): # parse results for result in dom.xpath(results_xpath): link = result.xpath(link_xpath)[0] links = result.xpath(link_xpath) if not links: continue link = links[0] url = link.attrib.get('href') title = escape(link.text_content()) Loading @@ -66,7 +73,8 @@ def response(resp): continue if result.xpath('./p[@class="desc"]'): content = escape(result.xpath('./p[@class="desc"]')[0].text_content()) content = escape(result.xpath('./p[@class="desc"]')[0] .text_content()) else: content = '' Loading Loading
searx/engines/startpage.py +20 −12 Original line number Diff line number Diff line ## Startpage (Web) # Startpage (Web) # # @website https://startpage.com # @provide-api no (nothing found) Loading @@ -17,7 +17,10 @@ import re # engine dependent config categories = ['general'] # there is a mechanism to block "bot" search (probably the parameter qid), require storing of qid's between mulitble search-calls # there is a mechanism to block "bot" search # (probably the parameter qid), require # storing of qid's between mulitble search-calls # paging = False language_support = True Loading @@ -44,7 +47,8 @@ def request(query, params): # set language if specified if params['language'] != 'all': params['data']['with_language'] = 'lang_' + params['language'].split('_')[0] params['data']['with_language'] = ('lang_' + params['language'].split('_')[0]) return params Loading @@ -57,7 +61,10 @@ def response(resp): # parse results for result in dom.xpath(results_xpath): link = result.xpath(link_xpath)[0] links = result.xpath(link_xpath) if not links: continue link = links[0] url = link.attrib.get('href') title = escape(link.text_content()) Loading @@ -66,7 +73,8 @@ def response(resp): continue if result.xpath('./p[@class="desc"]'): content = escape(result.xpath('./p[@class="desc"]')[0].text_content()) content = escape(result.xpath('./p[@class="desc"]')[0] .text_content()) else: content = '' Loading