XML分析:编码错误

2024-04-25 13:48:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我想解析以下列方式开始的XML文件:

<BAHFeed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" GeneratedAt="2015-11-10T12:01:10.1776621+01:00" Type="Sport" BettingOfferId="1" Lang="en">

尝试解析此xml时:

^{pr2}$

我收到以下错误消息:

xml.etree.ElementTree.ParseError: encoding specified in XML declaration is incorrect: line 1, column 30

这里怎么了?在


Tags: 文件instanceorghttpwww方式xmlxmlschema