Skip to content
Advertisement

How to update xml file using python beautifulsoup

I have a xml file for which I have to update a value of tag. Below is the content of the file

JavaScript

In the above content, I have to update the value of path with new valueBelow is the code I have:

JavaScript

But its not getting updated in xml file. Can anyone please help. Thanks

Advertisement

Answer

Using ElementTree (no need for any external lib)

JavaScript

output

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement