mirror of
				https://github.com/searxng/searxng.git
				synced 2025-11-02 18:47:05 -05:00 
			
		
		
		
	Merge pull request #2329 from return42/fix-bing-no-descr
[fix] Bing-WEB: use <span class='algoSlug_icon'> for the description
This commit is contained in:
		
						commit
						fed2bab65b
					
				@ -198,13 +198,11 @@ def response(resp):
 | 
				
			|||||||
        url = link.attrib.get('href')
 | 
					        url = link.attrib.get('href')
 | 
				
			||||||
        title = extract_text(link)
 | 
					        title = extract_text(link)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Make sure that the element is free of <a href> links and <span class='algoSlug_icon'>
 | 
					 | 
				
			||||||
        content = eval_xpath(result, '(.//p)[1]')
 | 
					        content = eval_xpath(result, '(.//p)[1]')
 | 
				
			||||||
        for p in content:
 | 
					        for p in content:
 | 
				
			||||||
 | 
					            # Make sure that the element is free of <a href> links
 | 
				
			||||||
            for e in p.xpath('.//a'):
 | 
					            for e in p.xpath('.//a'):
 | 
				
			||||||
                e.getparent().remove(e)
 | 
					                e.getparent().remove(e)
 | 
				
			||||||
            for e in p.xpath('.//span[@class="algoSlug_icon"]'):
 | 
					 | 
				
			||||||
                e.getparent().remove(e)
 | 
					 | 
				
			||||||
        content = extract_text(content)
 | 
					        content = extract_text(content)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # get the real URL either using the URL shown to user or following the Bing URL
 | 
					        # get the real URL either using the URL shown to user or following the Bing URL
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user