Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request : Having Node.copy() or LexborNode.copy() #117

Open
LeDilam opened this issue May 15, 2024 · 0 comments
Open

Feature request : Having Node.copy() or LexborNode.copy() #117

LeDilam opened this issue May 15, 2024 · 0 comments

Comments

@LeDilam
Copy link

LeDilam commented May 15, 2024

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant