1. 程式人生 > >python xml資料讀取

python xml資料讀取

①注意編碼 要在開頭加上import sys

 reload(sys)

sys.setdefaultencoding('utf8')

不然預設編碼是ascii碼,然後會很蛋疼

②讀取xml檔案 

http://www.jb51.net/article/50812.htm

這個網站講的很詳細

③如果是直接從網站上面獲取xml資料

將 xml.dom.minidom.parse改為 xml.dom.minidom.parseString

其他相同