[mod] purge local html_to_text
This commit is contained in:
		
							parent
							
								
									1408859b4b
								
							
						
					
					
						commit
						2181c4384e
					
				| @ -1,6 +1,7 @@ | |||||||
| import json | import json | ||||||
| from urllib import urlencode | from urllib import urlencode | ||||||
| from lxml import html | from lxml import html | ||||||
|  | from searx.utils import html_to_text | ||||||
| from searx.engines.xpath import extract_text | from searx.engines.xpath import extract_text | ||||||
| 
 | 
 | ||||||
| url = 'https://api.duckduckgo.com/'\ | url = 'https://api.duckduckgo.com/'\ | ||||||
| @ -17,11 +18,6 @@ def result_to_text(url, text, htmlResult): | |||||||
|         return text |         return text | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def html_to_text(htmlFragment): |  | ||||||
|     dom = html.fromstring(htmlFragment) |  | ||||||
|     return extract_text(dom) |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def request(query, params): | def request(query, params): | ||||||
|     # TODO add kl={locale} |     # TODO add kl={locale} | ||||||
|     params['url'] = url.format(query=urlencode({'q': query})) |     params['url'] = url.format(query=urlencode({'q': query})) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Adam Tauber
						Adam Tauber