The XML file looks like
<record rid="3247">
<bu_fg>BU</bu_fg>
<services_catalog_i>Access</services_catalog_i>
<request_type>RTB</request_type>
<date_created>1363138047045</date_created>
<actual_start_date/>
<actual_completed_date/>
<duration/>
<record_owner>John</record_owner>
<request_id>3247</request_id>
<requestor>john@gmail.com</requestor>
<assigned_to/>
<request_summary>John's message</request_summary>
<update_id>1363138047045</update_id>
</record>
and I'm trying to parse them and store each value in a tuple like (bu_fg, services_catalog_i, request_type...)
This is how my code looks like, I'm trying to recognize each "record" node and go inside them to parse my data:
from xml.dom.minidom import parse
dom = parse('result.xml')
record = dom.getElementsByTagName('record')
for node in record:
bufg = node.getElementsByTagName("bu_fg")
print bufg
However, this always prints [<DOM Element: bu_fg at 0x108ae39e0>] and I have no idea why...any suggestion? Thanks!

New Topic/Question
Reply




MultiQuote





|