'SwiftSoup: removeAttr having no effect when getting body of document

I am removing href attribute and adding it again with a different link.

    try document?.select(className).first()?.select(linkClassName).removeAttr("href")
    try document?.select(className).first()?.select(linkClassName).attr("href", link.utf8EncodedString())

But when I do try document?.body()?.html() it has no change in it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source