Guest User

Untitled

a guest
Feb 19th, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. from lxml import etree
  2.  
  3. node = etree.Element('node')
  4. node.append(etree.Element('child'))
  5. # another child with text
  6. child = etree.Element('child')
  7. child.text = 'some text'
  8. node.append(child)
  9.  
  10. s = etree.tostring(node, pretty_print=True)
  11. print s
Add Comment
Please, Sign In to add comment