is there any function in xml.etree or lxml to get the order of the tags
for example:
<html>
<body>
<p>example</p>
<h1 value="something"><a>example</a></h1>
<p value="something">example</p>
</body>
</html>
example of the output:
{[{'html':[{'body':[{'p':{'_text':'example'}},{'h1':{'_text':'','value':'something','a':{'_text':'example'}}},{'p':{'_text':'example','value':'something'}}]}]}]}
is there a function, library or something that can do something like this?
i tried xmltodict but it doesnt keep the order of the tags which i really need!
thanks in advance, have a great day.
question from:
https://stackoverflow.com/questions/66049803/how-do-i-get-the-order-of-tags-in-xml-file-with-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…