我正在尝试使用 ElementTree 解析 XML,但出现此错误:
xml.etree.ElementTree.ParseError: encoding specified in XML declaration is incorrect
我的文件.py:
from suds.client import Client
import xml.etree.ElementTree as ET
url = 'http://www.webservicex.com/globalweather.asmx?WSDL'
client = Client(url)
weather = client.service.GetWeather('Sao Paulo', 'Brazil')
print weather
parseWeather = ET.fromstring(weather) # >>>> Here I got my problem!
当我尝试从字符串天气解析我的 xml 时。有谁知道如何解决这种问题?