mirror of
				https://github.com/searxng/searxng
				synced 2024-01-01 19:24:07 +01:00 
			
		
		
		
	[fix] skip uncomplete image results - closes #1496
This commit is contained in:
		
							parent
							
								
									ec5adad851
								
							
						
					
					
						commit
						6ded6e7a9a
					
				
					 1 changed files with 6 additions and 7 deletions
				
			
		|  | @ -80,14 +80,13 @@ def response(resp): | |||
| 
 | ||||
|     # parse results | ||||
|     for result in dom.xpath('//div[@class="imgpt"]'): | ||||
| 
 | ||||
|         img_format = result.xpath('./div[contains(@class, "img_info")]/span/text()')[0] | ||||
|         # Microsoft seems to experiment with this code so don't make the path too specific, | ||||
|         # just catch the text section for the first anchor in img_info assuming this to be | ||||
|         # the originating site. | ||||
|         source = result.xpath('./div[contains(@class, "img_info")]//a/text()')[0] | ||||
| 
 | ||||
|         try: | ||||
|             img_format = result.xpath('./div[contains(@class, "img_info")]/span/text()')[0] | ||||
|             # Microsoft seems to experiment with this code so don't make the path too specific, | ||||
|             # just catch the text section for the first anchor in img_info assuming this to be | ||||
|             # the originating site. | ||||
|             source = result.xpath('./div[contains(@class, "img_info")]//a/text()')[0] | ||||
| 
 | ||||
|             m = loads(result.xpath('./a/@m')[0]) | ||||
| 
 | ||||
|             # strip 'Unicode private use area' highlighting, they render to Tux | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Adam Tauber
						Adam Tauber