You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have selected a node in the tree, and we want to modify the sub-tree (like filtering out some sub-branch) without affecting the original tree, we have to make a copy of the node and it's children.
But there is no Node.copy() or LexborNode.copy(). So instead of doing node_copy = node.copy(), we currently need to do node_copy = HTMLParser(node.html).body.child which looks laborious.
It seems that .clone() can only copy the whole tree which is not what I want.
So I'm asking, could we get a copy function for node ?
The text was updated successfully, but these errors were encountered:
If we have selected a node in the tree, and we want to modify the sub-tree (like filtering out some sub-branch) without affecting the original tree, we have to make a copy of the node and it's children.
But there is no
Node.copy()
orLexborNode.copy()
. So instead of doingnode_copy = node.copy()
, we currently need to donode_copy = HTMLParser(node.html).body.child
which looks laborious.It seems that
.clone()
can only copy the whole tree which is not what I want.So I'm asking, could we get a copy function for node ?
The text was updated successfully, but these errors were encountered: