Is there a way to deep clone JSoup Document object and get back exactly same HTML?
문제
Is there a way to deep clone JSoup Document object and get back exactly same HTML?
I have a pre-parsed object that I want to just clone because I suspect that clone would be faster than always parsing the HTML again.
I've tried to clone it by just iterating through of all the elements of the Document object, but then I'm left without the doctype declaration and such.
P.S. I don't of course expect to get the comments...
해결책
For any Node you can call .clone()
This was implemented in feature request.
제휴하지 않습니다 StackOverflow