How To Retrive Data From Odt Xml File In Python?
I am successfully retreving the odt xml file in python but I have no idea how to pull xml file data? Any techniques are there for pulling the odt xml file data. Here my code for ex
Solution 1:
Any techniques are there for pulling the odt xml file data.
I'm assuming you're curious about parsing this xml file's contents. If that is the case, I recommend BeautifulSoup. BS is intended for html parsing, but can be altered to accept xml data:
BS4:
from bs4 importBeautifulSoupsoup= Beautifulsoup(<xml file contents>, 'xml')
BeautifulSoup 3:
fromBeautifulSoupimportBeautifulStoneSoup
soup = BeautifulStoneSoup(<xmlfilecontents>)
From here you can parse the data according to the docs (linked above).
Post a Comment for "How To Retrive Data From Odt Xml File In Python?"