mirror of
				https://github.com/searxng/searxng.git
				synced 2025-11-03 19:17:07 -05:00 
			
		
		
		
	Bing news engine corrections
XPath *never* return None. (I found the HTML report of coverage)
This commit is contained in:
		
							parent
							
								
									efde2c21c8
								
							
						
					
					
						commit
						5761d6f0ab
					
				@ -59,7 +59,6 @@ def response(resp):
 | 
				
			|||||||
        url = link.attrib.get('href')
 | 
					        url = link.attrib.get('href')
 | 
				
			||||||
        title = extract_text(link)
 | 
					        title = extract_text(link)
 | 
				
			||||||
        contentXPath = result.xpath('.//div[@class="sn_txt"]/div//span[@class="sn_snip"]')
 | 
					        contentXPath = result.xpath('.//div[@class="sn_txt"]/div//span[@class="sn_snip"]')
 | 
				
			||||||
        if contentXPath is not None:
 | 
					 | 
				
			||||||
        content = escape(extract_text(contentXPath))
 | 
					        content = escape(extract_text(contentXPath))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # parse publishedDate
 | 
					        # parse publishedDate
 | 
				
			||||||
@ -67,7 +66,6 @@ def response(resp):
 | 
				
			|||||||
                                          '//span[contains(@class,"sn_ST")]'
 | 
					                                          '//span[contains(@class,"sn_ST")]'
 | 
				
			||||||
                                          '//span[contains(@class,"sn_tm")]')
 | 
					                                          '//span[contains(@class,"sn_tm")]')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if publishedDateXPath is not None:
 | 
					 | 
				
			||||||
        publishedDate = escape(extract_text(publishedDateXPath))
 | 
					        publishedDate = escape(extract_text(publishedDateXPath))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if re.match("^[0-9]+ minute(s|) ago$", publishedDate):
 | 
					        if re.match("^[0-9]+ minute(s|) ago$", publishedDate):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user