commit
						f1db60d28f
					
				| @ -1,9 +1,8 @@ | |||||||
| from urllib import urlencode | from urllib import urlencode | ||||||
| from lxml import html | from lxml import html | ||||||
| 
 | 
 | ||||||
| base_url = 'https://startpage.com/' | base_url = None | ||||||
| search_url = base_url+'do/search' | search_url = None | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| def request(query, params): | def request(query, params): | ||||||
|     global search_url |     global search_url | ||||||
| @ -24,6 +23,11 @@ def response(resp): | |||||||
|         link = result.xpath('.//h3/a')[0] |         link = result.xpath('.//h3/a')[0] | ||||||
|         url = link.attrib.get('href') |         url = link.attrib.get('href') | ||||||
|         title = link.text_content() |         title = link.text_content() | ||||||
|  | 
 | ||||||
|  |         content ='' | ||||||
|  |         if len(result.xpath('./p[@class="desc"]')): | ||||||
|             content = result.xpath('./p[@class="desc"]')[0].text_content() |             content = result.xpath('./p[@class="desc"]')[0].text_content() | ||||||
|  |          | ||||||
|         results.append({'url': url, 'title': title, 'content': content}) |         results.append({'url': url, 'title': title, 'content': content}) | ||||||
|  |      | ||||||
|     return results |     return results | ||||||
|  | |||||||
| @ -68,6 +68,13 @@ engines: | |||||||
| 
 | 
 | ||||||
|   - name : startpage |   - name : startpage | ||||||
|     engine : startpage |     engine : startpage | ||||||
|  |     base_url : 'https://startpage.com/' | ||||||
|  |     search_url : 'https://startpage.com/do/search' | ||||||
|  | 
 | ||||||
|  |   - name : ixquick | ||||||
|  |     engine : startpage | ||||||
|  |     base_url : 'https://www.ixquick.com/' | ||||||
|  |     search_url : 'https://www.ixquick.com/do/search' | ||||||
| 
 | 
 | ||||||
|   - name : twitter |   - name : twitter | ||||||
|     engine : twitter |     engine : twitter | ||||||
|  | |||||||
| @ -68,6 +68,13 @@ engines: | |||||||
| 
 | 
 | ||||||
|   - name : startpage |   - name : startpage | ||||||
|     engine : startpage |     engine : startpage | ||||||
|  |     base_url : 'https://startpage.com/' | ||||||
|  |     search_url : 'https://startpage.com/do/search' | ||||||
|  | 
 | ||||||
|  |   - name : ixquick | ||||||
|  |     engine : startpage | ||||||
|  |     base_url : 'https://www.ixquick.com/' | ||||||
|  |     search_url : 'https://www.ixquick.com/do/search' | ||||||
| 
 | 
 | ||||||
|   - name : twitter |   - name : twitter | ||||||
|     engine : twitter |     engine : twitter | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Adam Tauber
						Adam Tauber