Python: get the sub-elements of a xml element








According to Python XML ElementTree API,
  • get all sub-elements(descendants):
    all_descendants = list(element.iter())
  • get direct sub-elements(children):
    children = list(element)



No comments:

Post a Comment