Added comments and returned back to previous solution
This commit is contained in:
		@@ -56,7 +56,10 @@ def xpath(source: str, xpath: str) -> str:
 | 
				
			|||||||
        nsmap.pop(None)
 | 
					        nsmap.pop(None)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    result = root.xpath(xpath, namespaces=nsmap)
 | 
					    result = root.xpath(xpath, namespaces=nsmap)
 | 
				
			||||||
    if isinstance(result, etree._ElementUnicodeResult):
 | 
					    
 | 
				
			||||||
 | 
					    # root.xpath can return 4 types: float, string, bool and list.
 | 
				
			||||||
 | 
					    # List is the only one that can't be simply converted to str
 | 
				
			||||||
 | 
					    if result is not list:
 | 
				
			||||||
        return str(result)
 | 
					        return str(result)
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        result_string = ""
 | 
					        result_string = ""
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user