Home > other >  Consult a LXML process XML files in a problem
Consult a LXML process XML files in a problem

Time:09-22


Red
0
5 & lt;/bus>
1 & lt;/pop>
Blue

I use LXML batch processing a lot of XML file, use the xpath method to take out the need to use XML2Dict node after the tag name and text to the dictionary, but found that some text value without the label (tag is similar to the index value) is with the label on the back of the, for example, Sam's actual value is red, but the real value of a car is Not zero is Not configure, this how to deal with as a tag and the actual value corresponding to the dictionary, need to output is
{' Sam ':' red ', 'car' : 'Not configure', 'bus' :' string ', 'pop' : 'True', 'Jam' : 'blue'}

CodePudding user response:

Is there a big help to see ah

CodePudding user response:

Can use the comment () take out all the comments, but I don't know how to correspond
  • Related