How do I rename a node using LXML?
Specifically, how to rename a parent node i.e. a <body>
tag while preserving all the underlying structure?
I am parsing using the lxml.html
module but supposedly there shouldn't be any difference between xml and html in terms of renaming between lxml.html.HtmlElement
and its XML counterpart.
I have searched through the docs at the LXML site but didn't find any reference to renaming of nodes.