0
所以,我想在Python上處理XML文件。在Python 2.1上讀取XML
我使用minidom,因爲我在Python 2.1中,並且沒有更改到3.6。目前,我有這個
import xml.dom.minidom as minidom
import socket
print 'Getting the xml file'
# Get the xml contents
file = open('<filepath>')
#print file
# Get the root of the configuration file
print 'Parsing the xml'
procs = minidom.parse(file)
但我發現了這個錯誤
任何想法?或者,更好的,另一種方式來解析XML沒有我不得不寫我自己的解析器...
你確定是2.1的版本是否正確? –
是否升級到2.7選項? –
你可以安裝第三方模塊嗎?查看與lxml的舊版本的兼容性會很有趣... –