【发布时间】:2015-08-07 10:17:04
【问题描述】:
我正在尝试加载存储在 s3 上的 xsd 文档。它给了我以下错误
>>> from lxml import etree
>>> xsd_url = 'https://s3-us-west-1.amazonaws.com/premiere-avails/movie.xsd.xml'
>>> node=etree.fromstring(requests.get(xsd_url).text)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "lxml.etree.pyx", line 3092, in lxml.etree.fromstring (src/lxml/lxml.etree.c:70473)
File "parser.pxi", line 1823, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:106272)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
我验证了该文件实际上是正确的并且它在本地加载。我将如何从 s3 加载它?
【问题讨论】: