This is the script I have:
import BeautifulSoup if __name__ == "__main__": data = """ <root> <obj id="3"/> <obj id="5"/> <obj id="3"/> </root> """ soup = BeautifulSoup.BeautifulStoneSoup(data) print soup
At startup, this prints:
<root> <obj id="3"></obj> <obj id="5"></obj> <obj id="3"></obj> </root>
I would like to keep the same structure. How can i do this?
python xml beautifulsoup
Geo
source share