Fixed libXml
This commit is contained in:
@@ -56,10 +56,13 @@ def xpath(source: str, xpath: str) -> str:
|
||||
nsmap.pop(None)
|
||||
|
||||
result = root.xpath(xpath, namespaces=nsmap)
|
||||
result_string = ""
|
||||
for e in result:
|
||||
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
|
||||
return result_string
|
||||
if isinstance(result, etree._ElementUnicodeResult):
|
||||
return str(result)
|
||||
else:
|
||||
result_string = ""
|
||||
for e in result:
|
||||
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
|
||||
return result_string
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user